[FFmpeg-devel] [PATCH 3/3] avcodec/avcodec: free decoded_side_data in ff_codec_close() when decoding
James Almer
jamrial at gmail.com
Wed May 1 22:01:56 EEST 2024
It's set by the library, so it should be freed when closing the context.
Signed-off-by: James Almer <jamrial at gmail.com>
---
libavcodec/avcodec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index e560efff6a..189a0a2193 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -463,7 +463,9 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
av_freep(&avctx->coded_side_data[i].data);
av_freep(&avctx->coded_side_data);
avctx->nb_coded_side_data = 0;
- }
+ } else if (av_codec_is_decoder(avctx->codec))
+ av_frame_side_data_free(&avctx->decoded_side_data,
+ &avctx->nb_decoded_side_data);
av_buffer_unref(&avctx->hw_frames_ctx);
av_buffer_unref(&avctx->hw_device_ctx);
--
2.44.0
More information about the ffmpeg-devel
mailing list