diff mbox series

[FFmpeg-devel,7/7] avcodec/utvideodec: Fix integer overflow in decode_plane()

Message ID 20200510192019.14218-7-michael@niedermayer.cc
State Accepted
Commit 876cfa67f37e944b0f42cb67b2de4e2e06f52e82
Headers show
Series [FFmpeg-devel,1/7] avcodec/mpc: Fix multiple numerical overflows in ff_mpc_dequantize_and_synth() | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate fail Make fate failed

Commit Message

Michael Niedermayer May 10, 2020, 7:20 p.m. UTC
Fixes: signed integer overflow: 2147483594 + 142 cannot be represented in type 'int'
Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5658568101724160

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

Comments

Michael Niedermayer May 11, 2020, 11 p.m. UTC | #1
On Sun, May 10, 2020 at 09:20:19PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2147483594 + 142 cannot be represented in type 'int'
> Fixes: 20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_fuzzer-5658568101724160
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/utvideodec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 4da257fc61..c07636d435 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -317,7 +317,7 @@  static int decode_plane(UtvideoContext *c, int plane_no,
                 for (i = 0; i < width; i++) {
                     pix = fsym;
                     if (use_pred) {
-                        prev += pix;
+                        prev += (unsigned)pix;
                         pix   = prev;
                     }
                     dest[i] = pix;