diff mbox series

[FFmpeg-devel,1/2] avcodec/vmixdec: Fix signed integer overflow in dc

Message ID 20230905020358.32527-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/vmixdec: Fix signed integer overflow in dc | expand

Commit Message

Michael Niedermayer Sept. 5, 2023, 2:03 a.m. UTC
Fixes: signed integer overflow: 2147483181 + 1024 cannot be represented in type 'int'
Fixes: 61117/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-5387692433866752

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

Comments

Michael Niedermayer Sept. 25, 2023, 7:21 p.m. UTC | #1
On Tue, Sep 05, 2023 at 04:03:57AM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2147483181 + 1024 cannot be represented in type 'int'
> Fixes: 61117/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-5387692433866752
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vmixdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply this

[...]
diff mbox series

Patch

diff --git a/libavcodec/vmixdec.c b/libavcodec/vmixdec.c
index b77c90929a..8f2278b2ea 100644
--- a/libavcodec/vmixdec.c
+++ b/libavcodec/vmixdec.c
@@ -134,7 +134,7 @@  static int decode_dcac(AVCodecContext *avctx,
                     ac_run = get_ue_golomb_long(ac_gb);
             }
 
-            block[0] = dc + add;
+            block[0] = dc + (unsigned)add;
             s->idsp.idct_put(dst + x, linesize, block);
         }