mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-04 19:48:19 +00:00
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 2d221d9e06
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
54bc183897
commit
8bfe8b422a
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user