aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-11-14 09:42:44 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-01-15 01:17:07 +0100
commit3389d479acef93f67eaf021e93ca9b962cbebc43 (patch)
tree96f5e38c8466bf2a8c699c00965cda988036dc8d
parent53319cbe97877fe92a2af1586c4dd5c36cb95843 (diff)
downloadffmpeg-3389d479acef93f67eaf021e93ca9b962cbebc43.tar.gz
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@niedermayer.cc> (cherry picked from commit 28c96c2ce2781c2cd147a9f3c299e18ce1dc7ff8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 33927c26b3..d99f8bed77 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -661,6 +661,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));