diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 15733478e1426ceb62a725d2899a59143772e188..4d1c9bbb53110fed8185270d7cbc08e0833eb848 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -120,6 +120,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 */