avformat/aiffdec: Check sample_rate

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-10-31 00:02:04 +02:00
parent 28fac45bde
commit 1b04836dff
1 changed files with 3 additions and 0 deletions

View File

@ -120,6 +120,9 @@ static int get_aiff_header(AVFormatContext *s, int size,
sample_rate = val << exp;
else
sample_rate = (val + (1ULL<<(-exp-1))) >> -exp;
if (sample_rate <= 0)
return AVERROR_INVALIDDATA;
par->sample_rate = sample_rate;
if (size < 18)
return AVERROR_INVALIDDATA;