[FFmpeg-cvslog] avcodec/vorbisdec: Check remaining data in vorbis_residue_decode_internal()

Michael Niedermayer git at videolan.org
Sun Apr 14 23:25:34 EEST 2024


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 27 22:27:03 2024 +0100| [c7122a760e24da5f4888b58b558ed2ebda804056] | committer: Michael Niedermayer

avcodec/vorbisdec: Check remaining data in vorbis_residue_decode_internal()

Fixes: timeout
Fixes: 66326/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VORBIS_fuzzer-6295291863040000

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 dc89cf804a811c0d25f4649a99f7fab4b5b416fa)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c7122a760e24da5f4888b58b558ed2ebda804056
---

 libavcodec/vorbisdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index c748aa574f..9a60ed4770 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1451,6 +1451,9 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
                             unsigned step = FASTDIV(vr->partition_size << 1, dim << 1);
                             vorbis_codebook codebook = vc->codebooks[vqbook];
 
+                            if (get_bits_left(gb) <= 0)
+                                return AVERROR_INVALIDDATA;
+
                             if (vr_type == 0) {
 
                                 voffs = voffset+j*vlen;



More information about the ffmpeg-cvslog mailing list