[FFmpeg-cvslog] avutil/frame: free the old side data buffer before replacing it
James Almer
git at videolan.org
Thu Apr 11 18:33:11 EEST 2024
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Apr 11 12:32:11 2024 -0300| [dd5f665b4010f8a0142ce3cba3305b173eb37dfe] | committer: James Almer
avutil/frame: free the old side data buffer before replacing it
Fixes memleaks reported by ASAN/Valgrind.
Reported-by: Sean McGovern <gseanmcg at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd5f665b4010f8a0142ce3cba3305b173eb37dfe
---
libavutil/frame.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 10b9f7fa94..0775e2abd9 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -811,6 +811,7 @@ static AVFrameSideData *replace_side_data_from_buf(AVFrameSideData *dst,
return NULL;
av_dict_free(&dst->metadata);
+ av_buffer_unref(&dst->buf);
dst->buf = buf;
dst->data = buf->data;
dst->size = buf->size;
More information about the ffmpeg-cvslog
mailing list