Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-25 17:35:40 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-25 20:32:39 +0300
commitb946bd8ef2c7aeee09469a4901182a44f9b67189 (patch)
tree0078097849e7075b518b728ffe448d206f50c43b /libavcodec/diracdec.c
parent6d6fc4105b871490068958ded491dbb8b19c65be (diff)
avcodec/diracdec: Fix off by 1 error in quant check
Fixes: out of array read Fixes: 1781/clusterfuzz-testcase-minimized-4617176877105152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r--libavcodec/diracdec.c2
1 files changed, 1 insertions, 1 deletions
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;
}