diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-03 10:49:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-17 21:34:53 +0200 |
commit | 7c937067b521180227fa70315fe1c43daddbb138 (patch) | |
tree | 498a0f4366b77629419b4f56e181f8cdb8783220 | |
parent | f3a01b3543e6f618a65bdf3969764b00790697de (diff) | |
download | ffmpeg-7c937067b521180227fa70315fe1c43daddbb138.tar.gz |
avformat/aiffdec: Check that SSND is at least 8 bytes
Fixes: Infinite loop
Fixes: 30874/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5933710488764416
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 460d3dc41f57a6dcefbd72db6e2e368fee05340b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/aiffdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index f26951dcf8..a54bd92e7e 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -277,6 +277,8 @@ static int aiff_read_header(AVFormatContext *s) get_meta(s, "comment" , size); break; case MKTAG('S', 'S', 'N', 'D'): /* Sampled sound chunk */ + if (size < 8) + return AVERROR_INVALIDDATA; aiff->data_end = avio_tell(pb) + size; offset = avio_rb32(pb); /* Offset of sound data */ avio_rb32(pb); /* BlockSize... don't care */ |