1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-23 04:24:35 +02:00

avformat/wavdec: Check that smv block fits in available space

Fixes: OOM
Fixes: 56271/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-5290810045497344

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 a76efafdb9be966ae3ad52b32370dc644dd582bf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-03-05 00:51:38 +01:00
parent 77d1ae5d94
commit b79b50a308
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -647,6 +647,10 @@ smv_retry:
goto smv_out;
}
size = avio_rl24(s->pb);
if (size > wav->smv_block_size) {
ret = AVERROR_EOF;
goto smv_out;
}
ret = av_get_packet(s->pb, pkt, size);
if (ret < 0)
goto smv_out;