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>
This commit is contained in:
Michael Niedermayer 2021-10-04 23:54:46 +02:00
parent 8fe3566b8f
commit 849138f476

View File

@ -498,6 +498,8 @@ static int wav_read_header(AVFormatContext *s)
wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3; wav->smv_data_ofs = avio_tell(pb) + (size - 5) * 3;
avio_rl24(pb); avio_rl24(pb);
wav->smv_block_size = 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)); avpriv_set_pts_info(vst, 32, 1, avio_rl24(pb));
vst->duration = avio_rl24(pb); vst->duration = avio_rl24(pb);
avio_rl24(pb); avio_rl24(pb);