[FFmpeg-cvslog] avformat/wavdec: Check smv_block_size

Michael Niedermayer git at videolan.org
Thu Oct 21 00:41:20 EEST 2021


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Mon Oct  4 23:54:46 2021 +0200| [4069494725d70082d343f6aa6bca330424932987] | committer: Michael Niedermayer

avformat/wavdec: Check smv_block_size

Fixes: Timeout
Fixes: 39554/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-4915221701984256

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 849138f476f4b08656681bfc3aec5beac47777fb)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/wavdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 11763cf0ce..0e3de6e2e6 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -480,6 +480,8 @@ static int wav_read_header(AVFormatContext *s)
             wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
             avio_rl24(pb);
             wav->smv_block_size = avio_rl24(pb);
+            if (!wav->smv_block_size)
+                return AVERROR_INVALIDDATA;
             avpriv_set_pts_info(vst, 32, 1, avio_rl24(pb));
             vst->duration = avio_rl24(pb);
             avio_rl24(pb);



More information about the ffmpeg-cvslog mailing list