diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 601d701bc8..c031b40b5e 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -823,7 +823,7 @@ static int decode_hq_slice(DiracContext *s, DiracSlice *slice, uint8_t *tmp_buf) skip_bits_long(gb, 8*s->highquality.prefix_bytes); quant_idx = get_bits(gb, 8); - if (quant_idx > DIRAC_MAX_QUANT_INDEX) { + if (quant_idx > DIRAC_MAX_QUANT_INDEX - 1) { av_log(s->avctx, AV_LOG_ERROR, "Invalid quantization index - %i\n", quant_idx); return AVERROR_INVALIDDATA; }