aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-26 13:20:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-11-12 02:55:46 +0100
commitf10ba15d7371203e16cee3fb9e46bae9febcb6da (patch)
treea36811ec06097a62608b9751673c5d664e854557
parent54661cf0b2c9b0218e419b7cc3fd095a59762cda (diff)
downloadffmpeg-f10ba15d7371203e16cee3fb9e46bae9febcb6da.tar.gz
avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
Fixes: invalid_read.nut Found-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2d221d9e069e6269cb41f3678f2734800171d87b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index d828aaf3ef..7dcce95caa 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -305,7 +305,7 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
for (i = 0; i < f->plane_count; i++) {
PlaneContext * const p = &fs->plane[i];
int idx = get_symbol(c, state, 0);
- if (idx > (unsigned)f->quant_table_count) {
+ if (idx >= (unsigned)f->quant_table_count) {
av_log(f->avctx, AV_LOG_ERROR, "quant_table_index out of range\n");
return -1;
}