diff mbox series

[FFmpeg-devel,4/5] avcodec/h264_slice: Use unsigned for fgs seed computation

Message ID 20221218170823.32130-4-michael@niedermayer.cc
State Accepted
Commit 685c0cfd3224b7febabc1877426f5efd489b7570
Headers show
Series [FFmpeg-devel,1/5] avcodec/tiff: Check camera_calibration for 0 | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Dec. 18, 2022, 5:08 p.m. UTC
Fixes: signed integer overflow: 2147481600 + 13408 cannot be represented in type 'int'
Fixes: 53963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4650467311616000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/h264_slice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 11, 2023, 10:32 a.m. UTC | #1
On Sun, Dec 18, 2022 at 06:08:22PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2147481600 + 13408 cannot be represented in type 'int'
> Fixes: 53963/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4650467311616000
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/h264_slice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 420758ba0a..6188c74632 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1228,7 +1228,7 @@  static int h264_export_frame_props(H264Context *h)
 
     ret = ff_h2645_sei_to_frame(out, &h->sei.common, AV_CODEC_ID_H264, h->avctx,
                                 &sps->vui, sps->bit_depth_luma, sps->bit_depth_chroma,
-                                cur->poc + (h->poc_offset << 5));
+                                cur->poc + (unsigned)(h->poc_offset << 5));
     if (ret < 0)
         return ret;