1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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>
This commit is contained in:
Michael Niedermayer
2024-12-08 02:56:28 +01:00
parent 61ff3047c5
commit e8c94e31da

View File

@ -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;