Commit bd3672ba authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/img2dec: Fix probe_buffer leak in ff_img_read_header()

Fixes: memleak
Fixes: 15171/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5683881644130304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5ea7f205
...@@ -356,6 +356,7 @@ int ff_img_read_header(AVFormatContext *s1) ...@@ -356,6 +356,7 @@ int ff_img_read_header(AVFormatContext *s1)
} }
if (s1->flags & AVFMT_FLAG_CUSTOM_IO) { if (s1->flags & AVFMT_FLAG_CUSTOM_IO) {
avio_seek(s1->pb, 0, SEEK_SET); avio_seek(s1->pb, 0, SEEK_SET);
av_freep(&probe_buffer);
} else } else
ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size); ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment