diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 413ae54748..82cfa22881 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -119,6 +119,8 @@ static int get_aiff_header(AVFormatContext *s, int size, else sample_rate = (val + (1ULL<<(-exp-1))) >> -exp; par->sample_rate = sample_rate; + if (size < 18) + return AVERROR_INVALIDDATA; size -= 18; /* get codec id for AIFF-C */