[FFmpeg-cvslog] avcodec/ffv1dec: Fix off by 1 error with quant tables

Michael Niedermayer git at videolan.org
Tue Dec 22 01:31:23 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Dec 19 00:22:04 2020 +0100| [5cae71d2b722d0beed4d46f189db42fbb57d877b] | committer: Michael Niedermayer

avcodec/ffv1dec: Fix off by 1 error with quant tables

Fixes: assertion failure
Fixes: 28447/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5369575948550144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index c704373cfe..0a3f425493 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -786,7 +786,7 @@ static int read_header(FFV1Context *f)
 
             if (f->version == 2) {
                 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 AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list