[FFmpeg-cvslog] avformat/iamf_parse: Check for 0 samples
Michael Niedermayer
git at videolan.org
Sat Aug 3 00:18:13 EEST 2024
ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 31 20:06:49 2024 +0200| [f2145744a2e283e91eb4dc337c2c414af1bad283] | committer: Michael Niedermayer
avformat/iamf_parse: Check for 0 samples
Fixes: division by zero
Fixes: 70561/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6199435013455872
Fixes: 70565/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5783790316748800
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit ed96ac87a94aa0943412af93ef51c22cdc4c907c)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f2145744a2e283e91eb4dc337c2c414af1bad283
---
libavformat/iamf_parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
index 3eb36f56f5..a222a46c86 100644
--- a/libavformat/iamf_parse.c
+++ b/libavformat/iamf_parse.c
@@ -252,7 +252,7 @@ static int codec_config_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
if (ret < 0)
goto fail;
- if ((codec_config->nb_samples > INT_MAX) ||
+ if ((codec_config->nb_samples > INT_MAX) || codec_config->nb_samples <= 0 ||
(-codec_config->audio_roll_distance > INT_MAX / codec_config->nb_samples)) {
ret = AVERROR_INVALIDDATA;
goto fail;
More information about the ffmpeg-cvslog
mailing list