diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-04-23 17:28:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-07-31 22:08:15 +0200 |
commit | bae2e1977744f42d56b85193d4910811de829714 (patch) | |
tree | 83f6fff99b9a5386d49a225a2f8f001d6c23f33e /libavformat/aiffdec.c | |
parent | 75a099fc734a4ee2b1347d0a3d8c53d883b95174 (diff) | |
download | ffmpeg-bae2e1977744f42d56b85193d4910811de829714.tar.gz |
avformat/aiffdec: Check for size overflow in header parsing
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6723467048255488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r-- | libavformat/aiffdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index cade05a9d6..a826bc998a 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -100,6 +100,9 @@ static int get_aiff_header(AVFormatContext *s, int size, int sample_rate; unsigned int num_frames; + if (size == INT_MAX) + return AVERROR_INVALIDDATA; + if (size & 1) size++; par->codec_type = AVMEDIA_TYPE_AUDIO; |