aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-10-04 23:54:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:21 +0200
commitaf682e4d2eeb26f46a745a71c72c507b1d5db378 (patch)
treef8cf91d94d531f508af957f108d99bb7b73b7c40
parent6d7f466d72344592cc8d3b429c081b11a8b250e1 (diff)
downloadffmpeg-af682e4d2eeb26f46a745a71c72c507b1d5db378.tar.gz
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@niedermayer.cc> (cherry picked from commit 849138f476f4b08656681bfc3aec5beac47777fb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/wavdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 1f07696d21..f9f679f68d 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -479,6 +479,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);