diff options
author | James Almer <jamrial@gmail.com> | 2024-04-11 12:32:11 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2024-04-11 12:32:13 -0300 |
commit | dd5f665b4010f8a0142ce3cba3305b173eb37dfe (patch) | |
tree | c10b172ecedd7ca207d956bff4bffbe994ff905e /libavutil/frame.c | |
parent | 6d0c89980c78ffd3b112676186786334c915ace7 (diff) | |
download | ffmpeg-dd5f665b4010f8a0142ce3cba3305b173eb37dfe.tar.gz |
avutil/frame: free the old side data buffer before replacing it
Fixes memleaks reported by ASAN/Valgrind.
Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |