aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-19 00:22:04 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-11 21:23:48 +0200
commit6e093adcccfaae663805c74e3c404fcb403d0378 (patch)
treeb2dd59d2ed2e39b146d7eda0d7d2bbcc85cd6327
parent3049331a493ed9f7e4f7ca92dbd6fd6c464779f2 (diff)
downloadffmpeg-6e093adcccfaae663805c74e3c404fcb403d0378.tar.gz
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@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 5cae71d2b722d0beed4d46f189db42fbb57d877b) 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 9a58bb601c..10962fd2d7 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -761,7 +761,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;