summaryrefslogtreecommitdiff
path: root/libavcodec/ffv1dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-26 13:20:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-26 13:42:04 +0200
commit2d221d9e069e6269cb41f3678f2734800171d87b (patch)
tree52897af4de8be51ee9551a6e837a66a87fdc6dbe /libavcodec/ffv1dec.c
parent10bbf6cf622f8a954c6cc694ca07c24f989c99af (diff)
downloadffmpeg-2d221d9e069e6269cb41f3678f2734800171d87b.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>
Diffstat (limited to 'libavcodec/ffv1dec.c')
-rw-r--r--libavcodec/ffv1dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 2a1fc0d9d6..662ef13fff 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;
}