[FFmpeg-cvslog] avcodec/svq3: Check there are bits left before decompression
Michael Niedermayer
git at videolan.org
Fri May 16 02:49:38 EEST 2025
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun May 11 01:35:29 2025 +0200| [c284ef000a52cc1c40b1acbb9d1cf9f592b422a0] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit c06f5b3ab97b1b1d0420309201568e38b3920860)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c284ef000a52cc1c40b1acbb9d1cf9f592b422a0
---
libavcodec/svq3.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 124699ade7..a7d74b2e5f 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list