aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-04-23 17:28:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-09 13:54:52 +0200
commit150642566c84a92070ddf7d0bbdbec52b2a77cbf (patch)
treee446fefd963a7c1d2eff308d4a739406bfedf263 /libavformat
parent7cf552af041988d81c79757dd945c8181bf43bf8 (diff)
downloadffmpeg-150642566c84a92070ddf7d0bbdbec52b2a77cbf.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> (cherry picked from commit bae2e1977744f42d56b85193d4910811de829714) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aiffdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 39343dab0f..6e14df0328 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -101,6 +101,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;