[FFmpeg-cvslog] avformat/aiffdec: Check for size overflow in header parsing

Michael Niedermayer git at videolan.org
Wed Sep 8 22:43:29 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Fri Apr 23 17:28:29 2021 +0200| [666631324803665d52b8635cbc99a91d0419cf1f] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit bae2e1977744f42d56b85193d4910811de829714)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=666631324803665d52b8635cbc99a91d0419cf1f
---

 libavformat/aiffdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index dcaf1560b6..8b85fea809 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;



More information about the ffmpeg-cvslog mailing list