diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-12 20:47:52 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-06 17:03:15 +0300 |
commit | b26f303865f3edd0055386d2b5c6a96d8eec8a37 (patch) | |
tree | cce1fb45851e8305bf332b96d6b124d0dde40d7b /libavcodec/truemotion2.c | |
parent | 745040d269bf642620a2046924caf43cd7572079 (diff) |
avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block()
Fixes: signed integer overflow: 1778647621 + 574372924 cannot be represented in type 'int'
Fixes: 18692/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-6248679635943424
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 93d52a181ec050d3a4fb68f526604d39cd006be5)
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 085c1b5261..4279ef9ef9 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -577,10 +577,10 @@ static inline void tm2_low_res_block(TM2Context *ctx, AVFrame *pic, int bx, int last[0] = (int)((unsigned)last[1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3])>> 1; last[2] = (int)((unsigned)last[1] + last[3]) >> 1; - t1 = ctx->D[0] + ctx->D[1]; + t1 = ctx->D[0] + (unsigned)ctx->D[1]; ctx->D[0] = t1 >> 1; ctx->D[1] = t1 - (t1 >> 1); - t2 = ctx->D[2] + ctx->D[3]; + t2 = ctx->D[2] + (unsigned)ctx->D[3]; ctx->D[2] = t2 >> 1; ctx->D[3] = t2 - (t2 >> 1); |