[FFmpeg-cvslog] avcodec/ffv1dec: Check that num h/v slices is supported
Michael Niedermayer
git at videolan.org
Thu Oct 19 14:30:44 EEST 2023
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 18 22:33:02 2023 +0100| [8094b114119f1b8bad43a1a1596645111e6fb2c3] | committer: Michael Niedermayer
avcodec/ffv1dec: Check that num h/v slices is supported
Fixes: out of array access
Fixes: 55597/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4898293416329216
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 8ead0ae68eb64ad325efafd686c434727f3d666a)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8094b114119f1b8bad43a1a1596645111e6fb2c3
---
libavcodec/ffv1dec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 0888c3c2a7..c0c1549a2f 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -579,6 +579,11 @@ static int read_extra_header(FFV1Context *f)
return AVERROR_INVALIDDATA;
}
+ if (f->num_h_slices > MAX_SLICES / f->num_v_slices) {
+ av_log(f->avctx, AV_LOG_ERROR, "slice count unsupported\n");
+ return AVERROR_PATCHWELCOME;
+ }
+
f->quant_table_count = get_symbol(c, state, 0);
if (f->quant_table_count > (unsigned)MAX_QUANT_TABLES || !f->quant_table_count) {
av_log(f->avctx, AV_LOG_ERROR, "quant table count %d is invalid\n", f->quant_table_count);
More information about the ffmpeg-cvslog
mailing list