1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avformat/aiffdec: Check size before subtraction in get_aiff_header()

Fixes: Infinite loop
Fixes: 27235/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5761398380167168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8af299acde9601e64740b75430960503615873b4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-11-10 23:01:12 +01:00
parent 3bdf23b9fe
commit 35d9e182b9

View File

@ -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 */