[FFmpeg-devel] [PATCH 1/2] avformat/aiffdec: Check block_duration

Michael Niedermayer michael at niedermayer.cc
Sat Sep 17 17:32:08 EEST 2022


Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/aiffdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 0487d3f0299..318e3ad742e 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -372,6 +372,8 @@ got_sound:
         av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid block_align value\n");
         return AVERROR_INVALIDDATA;
     }
+    if (aiff->block_duration < 0)
+        return AVERROR_INVALIDDATA;
 
     /* Now positioned, get the sound data start and end */
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
-- 
2.17.1



More information about the ffmpeg-devel mailing list