diff mbox

[FFmpeg-devel,4/4] avcodec/truemotion2: Fix integer overflow in last loop in tm2_update_block()

Message ID 20190613183236.19353-4-michael@niedermayer.cc
State Accepted
Commit 3aecd0170413c7e56f19de4e34d093a2c4027c2a
Headers show

Commit Message

Michael Niedermayer June 13, 2019, 6:32 p.m. UTC
Fixes: signed integer overflow: -1727985666 - 538976288 cannot be represented in type 'int'
Fixes: 15031/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5100228035739648

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/truemotion2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer June 25, 2019, 7:46 a.m. UTC | #1
On Thu, Jun 13, 2019 at 08:32:36PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -1727985666 - 538976288 cannot be represented in type 'int'
> Fixes: 15031/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5100228035739648
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/truemotion2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox

Patch

diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index ade214effc..a86dd16e0f 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -681,7 +681,7 @@  static inline void tm2_still_block(TM2Context *ctx, AVFrame *pic, int bx, int by
 static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int by)
 {
     int i, j;
-    int d;
+    unsigned d;
     TM2_INIT_POINTERS_2();
 
     /* update chroma */