mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-09 03:10:08 +00:00
avformat/id3v2: Sanity check tlen before alloc and uncompress
Fixes: Timeout (>20sec -> 65ms)
Fixes: 26896/clusterfuzz-testcase-minimized-ffmpeg_dem_DAUD_fuzzer-5691024049176576
Fixes: 27627/clusterfuzz-testcase-minimized-ffmpeg_dem_AEA_fuzzer-4907019324358656
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d7f87a4b9e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8d4d02c13a
commit
7dcf0f1ebb
1 changed files with 3 additions and 0 deletions
|
|
@ -1002,6 +1002,9 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary **metadata,
|
|||
|
||||
av_log(s, AV_LOG_DEBUG, "Compresssed frame %s tlen=%d dlen=%ld\n", tag, tlen, dlen);
|
||||
|
||||
if (tlen <= 0)
|
||||
goto seek;
|
||||
|
||||
av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
|
||||
if (!uncompressed_buffer) {
|
||||
av_log(s, AV_LOG_ERROR, "Failed to alloc %ld bytes\n", dlen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue