mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
avcodec/svq3: Check there are bits left before decompression
Fixes: out of array read
Fixes: 402587670/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-6343867775647744
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 c06f5b3ab9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1259,6 +1259,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx)
|
||||
uint8_t *buf;
|
||||
|
||||
if (watermark_height <= 0 ||
|
||||
get_bits_left(&gb) <= 0 ||
|
||||
(uint64_t)watermark_width * 4 > UINT_MAX / watermark_height)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user