From c7c92240a933e41392560c8086923d0d1c7aada2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Fri, 3 Feb 2023 05:12:38 +0000 Subject: [PATCH] image_pool: properly free frames av_frame_unref() only frees the buffers, not the frame data itself. --- video/mp_image_pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c index d80c65d3b5..f0bf3d9378 100644 --- a/video/mp_image_pool.c +++ b/video/mp_image_pool.c @@ -346,8 +346,8 @@ bool mp_image_hw_upload(struct mp_image *hw_img, struct mp_image *src) ok = av_hwframe_transfer_data(dstav, srcav, 0) >= 0; done: - av_frame_unref(srcav); - av_frame_unref(dstav); + av_frame_free(&srcav); + av_frame_free(&dstav); if (ok) mp_image_copy_attributes(hw_img, src);