[FFmpeg-devel] [PATCH 5/9] avcodec/cbs_h266_syntax_template: Check bit depth with range extension
Michael Niedermayer
michael at niedermayer.cc
Fri Sep 20 01:56:35 EEST 2024
Fixes: shift exponent 62 is too large for 32-bit type 'int'
Fixes: 71020/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VVC_fuzzer-6444916325023744
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/cbs_h266_syntax_template.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index a8f5af04d02..1c111126563 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -1041,6 +1041,9 @@ static int FUNC(sps_range_extension)(CodedBitstreamContext *ctx, RWContext *rw,
{
int err;
+ if (current->sps_bitdepth_minus8 < 10)
+ return AVERROR_INVALIDDATA;
+
flag(sps_extended_precision_flag);
if (current->sps_transform_skip_enabled_flag)
flag(sps_ts_residual_coding_rice_present_in_sh_flag);
--
2.46.1
More information about the ffmpeg-devel
mailing list