[FFmpeg-cvslog] avcodec/diracdec: Check component quant
Michael Niedermayer
git at videolan.org
Thu Mar 28 18:33:37 EET 2019
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Wed Nov 14 09:42:44 2018 +0100| [e726cd332dcfa58acf7115c29170fb1b93feb3e5] | committer: Michael Niedermayer
avcodec/diracdec: Check component quant
Fixes: Timeout
Fixes: 10708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5730140957442048
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 28c96c2ce2781c2cd147a9f3c299e18ce1dc7ff8)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e726cd332dcfa58acf7115c29170fb1b93feb3e5
---
libavcodec/diracdec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 04f54634e0..67aaf1f0c3 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -667,6 +667,10 @@ static void decode_component(DiracContext *s, int comp)
b->length = get_interleaved_ue_golomb(&s->gb);
if (b->length) {
b->quant = get_interleaved_ue_golomb(&s->gb);
+ if (b->quant > (DIRAC_MAX_QUANT_INDEX - 1)) {
+ av_log(s->avctx, AV_LOG_ERROR, "Unsupported quant %d\n", b->quant);
+ b->quant = 0;
+ }
align_get_bits(&s->gb);
b->coeff_data = s->gb.buffer + get_bits_count(&s->gb)/8;
b->length = FFMIN(b->length, FFMAX(get_bits_left(&s->gb)/8, 0));
More information about the ffmpeg-cvslog
mailing list