[FFmpeg-cvslog] avcodec/ffv1dec: Fix off by 1 error in quant_table_count check

Michael Niedermayer git at videolan.org
Thu Nov 26 17:54:57 CET 2015


ffmpeg | branch: release/2.5 | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 26 13:20:59 2015 +0200| [8bfe8b422a8ee23faaa668a40d585ac9dcab09cb] | committer: Michael Niedermayer

avcodec/ffv1dec: Fix off by 1 error in quant_table_count check

Fixes: invalid_read.nut
Found-by: Paul B Mahol <onemda at gmail.com>

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 2d221d9e069e6269cb41f3678f2734800171d87b)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8bfe8b422a8ee23faaa668a40d585ac9dcab09cb
---

 libavcodec/ffv1dec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index d5f7a2b..c338200 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -306,7 +306,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;
         }



More information about the ffmpeg-cvslog mailing list