From 1a2d690da2f28b1177b56e2498a82de2db0efd8d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 10 Oct 2026 05:23:52 +0200 Subject: [PATCH] avcodec/h264_cabac: do not adjust the CABAC mb_type of SI slices Undefined shift Replicated through API with UBSAN on i386 Fixes: left shift of 1621233664 by 2 places cannot be represented in type 'int' Fixes: 538751135/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5842595151151104 Fixes: 88lh9wyp3VpG Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/h264_cabac.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 703b27aa96..7fc4817634 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -2018,8 +2018,6 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl) } } else { mb_type = decode_cabac_intra_mb_type(sl, 3, 1); - if (sl->slice_type == AV_PICTURE_TYPE_SI && mb_type) - mb_type--; av_assert2(sl->slice_type_nos == AV_PICTURE_TYPE_I); decode_intra_mb: partition_count = 0;