[FFmpeg-cvslog] vulkan_decode: fix small memory leak

Lynne git at videolan.org
Thu Jun 22 19:22:41 EEST 2023


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Tue Jun 13 06:13:10 2023 +0200| [d9af84426bfea003e06c4f389f4d1666c3515340] | committer: Lynne

vulkan_decode: fix small memory leak

This requires using the new AVHWFramesContext.opaque field, as
otherwise, the profile attached to the decoder will be freed
before the frames context, rendering the frames context useless.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d9af84426bfea003e06c4f389f4d1666c3515340
---

 libavcodec/vulkan_decode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 3c348c533f..afcdcd8021 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -584,6 +584,8 @@ static void free_common(void *opaque, uint8_t *data)
                                           s->hwctx->alloc);
 
     ff_vk_uninit(s);
+
+    av_free(ctx);
 }
 
 static int vulkan_decode_bootstrap(AVCodecContext *avctx, AVBufferRef *frames_ref)



More information about the ffmpeg-cvslog mailing list