aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-12-08 02:56:28 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2024-12-24 02:55:50 +0100
commite8c94e31da65856920434813368956640c771684 (patch)
tree32c99747420223303a430b45566827d21b0e7f3b
parent61ff3047c577372cb3890b0e0eb6f556c0f8de8c (diff)
downloadffmpeg-e8c94e31da65856920434813368956640c771684.tar.gz
avformat/mov: free stream_info when the surrounding array is freed
Fixes: memleak Fixes: 378408474/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5699368121860096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 26f1bf7e1b..d6aeae048f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10921,6 +10921,9 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
// Discard current fragment index
if (mov->frag_index.allocated_size > 0) {
+ for(int i = 0; i < mov->frag_index.nb_items; i++) {
+ av_freep(&mov->frag_index.item[i].stream_info);
+ }
av_freep(&mov->frag_index.item);
mov->frag_index.nb_items = 0;
mov->frag_index.allocated_size = 0;