aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/frame.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-04-11 12:32:11 -0300
committerJames Almer <jamrial@gmail.com>2024-04-11 12:32:13 -0300
commitdd5f665b4010f8a0142ce3cba3305b173eb37dfe (patch)
treec10b172ecedd7ca207d956bff4bffbe994ff905e /libavutil/frame.c
parent6d0c89980c78ffd3b112676186786334c915ace7 (diff)
downloadffmpeg-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.c1
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;