summaryrefslogtreecommitdiff
path: root/libavformat/aiffdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-10 23:01:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-01-29 19:36:46 +0100
commit8af299acde9601e64740b75430960503615873b4 (patch)
tree3b3a85119feaa43a800ef111a44f1794a2278c9d /libavformat/aiffdec.c
parentc6edbf009063275365362c343fdbd6d24c838e3f (diff)
downloadffmpeg-8af299acde9601e64740b75430960503615873b4.tar.gz
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>
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r--libavformat/aiffdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 15733478e1..4d1c9bbb53 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 */