aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-03-03 10:49:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commit118c895270eece7db31cf195ba6e2d4789fe4310 (patch)
treecd8b27d0b82c99a062a38d1e1259b72e76af7ff1
parenta2e344eac478762b6ae27b41ee30ff63b5999123 (diff)
downloadffmpeg-118c895270eece7db31cf195ba6e2d4789fe4310.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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index ca84a89e6c..e660531801 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -284,6 +284,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 */