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 <mich...@niedermayer.cc>
---
 libavformat/mov.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 24feadb95b3..40535ec21d9 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -10953,6 +10953,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;
-- 
2.47.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to