diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 82cfa22881..39343dab0f 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 */