Browse Source

avcodec/truemotion2: Fix integer overflow in TM2_RECALC_BLOCK()

Fixes: signed integer overflow: 1477974040 - -1877995504 cannot be represented in type 'int'
Fixes: 4861/clusterfuzz-testcase-minimized-4570316383715328

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 56a53340ed)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.7
Michael Niedermayer 7 years ago
parent
commit
162bbc22e2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/truemotion2.c

+ 2
- 2
libavcodec/truemotion2.c View File

@@ -441,8 +441,8 @@ static inline int GET_TOK(TM2Context *ctx,int type)

/* recalculate last and delta values for next blocks */
#define TM2_RECALC_BLOCK(CHR, stride, last, CD) {\
CD[0] = CHR[1] - last[1];\
CD[1] = (int)CHR[stride + 1] - (int)CHR[1];\
CD[0] = (unsigned)CHR[ 1] - (unsigned)last[1];\
CD[1] = (unsigned)CHR[stride + 1] - (unsigned) CHR[1];\
last[0] = (int)CHR[stride + 0];\
last[1] = (int)CHR[stride + 1];}



Loading…
Cancel
Save