diff mbox

[FFmpeg-devel,1/3] avcodec/truemotion2: Fix overflow in tm2_apply_deltas()

Message ID 20180605004746.13051-1-michael@niedermayer.cc
State Accepted
Commit 79c6047c3668c639f717b3a7001a34dddba0ede2
Headers show

Commit Message

Michael Niedermayer June 5, 2018, 12:47 a.m. UTC
Fixes: signed integer overflow: 1077952576 + 1077952576 cannot be represented in type 'int'
Fixes: 7712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5056281753681920

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

Comments

Michael Niedermayer June 6, 2018, 6:49 p.m. UTC | #1
On Tue, Jun 05, 2018 at 02:47:44AM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 1077952576 + 1077952576 cannot be represented in type 'int'
> Fixes: 7712/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5056281753681920
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/truemotion2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply patchset


[...]
diff mbox

Patch

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index f7dbe047c7..b689efdb99 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -451,7 +451,7 @@  static inline int GET_TOK(TM2Context *ctx,int type)
 /* common operations - add deltas to 4x4 block of luma or 2x2 blocks of chroma */
 static inline void tm2_apply_deltas(TM2Context *ctx, int* Y, int stride, int *deltas, int *last)
 {
-    int ct, d;
+    unsigned ct, d;
     int i, j;
 
     for (j = 0; j < 4; j++){