summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-01 07:22:06 +0100
committerwm4 <wm4@nowhere>2017-12-01 08:01:41 +0100
commitafd5f3227ec38fea70bf7abfcd107a9493aa21fc (patch)
tree2f16b4bef7550aa4096400f76331b6289eef584b
parentc5fac0c2b048b695bf217ae77530269605eebfb9 (diff)
downloadmpv-afd5f3227ec38fea70bf7abfcd107a9493aa21fc.tar.bz2
mpv-afd5f3227ec38fea70bf7abfcd107a9493aa21fc.tar.xz
video: fix memory leaks with hwdec copy modes
This leaked 2 unreffed AVFrame structs (roughly 1KB) per decoded frame. Can I blame the FFmpeg API and the weird difference between freeing and unreffing an AVFrame?
-rw-r--r--video/mp_image_pool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c
index ff743b4da7..809b4f3352 100644
--- a/video/mp_image_pool.c
+++ b/video/mp_image_pool.c
@@ -297,9 +297,9 @@ struct mp_image *mp_image_hw_download(struct mp_image *src,
}
int res = av_hwframe_transfer_data(dstav, srcav, 0);
- av_frame_unref(srcav);
+ av_frame_free(&srcav);
dst = mp_image_from_av_frame(dstav);
- av_frame_unref(dstav);
+ av_frame_free(&dstav);
if (res >= 0 && dst) {
mp_image_set_size(dst, src->w, src->h);
mp_image_copy_attributes(dst, src);