diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-04-20 02:05:44 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-27 18:50:47 +0300 |
commit | 5ea8ce3b37747b0e255d40b486c20943262c2334 (patch) | |
tree | 0f969c7f441b1bdf80a161a9a7255d0ca764e85f /libavcodec/truemotion2.c | |
parent | 08d736d5363e1ad9210f2067de3bedc9a9229b45 (diff) |
avcodec/truemotion2: Fix 2 integer overflows in tm2_update_block()
Fixes: signed integer overflow: -2147483648 + -1 cannot be represented in type 'int'
Fixes: 14107/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5694078680825856
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 f4a1b8d409639b2394589efe20ad55410cce391c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/truemotion2.c')
-rw-r--r-- | libavcodec/truemotion2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 4bfe6e14ad..60354fd4a0 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -678,8 +678,8 @@ static inline void tm2_update_block(TM2Context *ctx, AVFrame *pic, int bx, int b /* update chroma */ for (j = 0; j < 2; j++) { for (i = 0; i < 2; i++) { - U[i] = Uo[i] + GET_TOK(ctx, TM2_UPD); - V[i] = Vo[i] + GET_TOK(ctx, TM2_UPD); + U[i] = Uo[i] + (unsigned)GET_TOK(ctx, TM2_UPD); + V[i] = Vo[i] + (unsigned)GET_TOK(ctx, TM2_UPD); } U += Ustride; V += Vstride; |