aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-15 23:22:50 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commit8ba17766a6b30db78c638b9f86b3cc57985d2006 (patch)
tree996c8591d9342abf8d19794befaea2e5a9fb70fc /libavcodec
parent8fed01d713603c352f2079dcb45d45278cabeb18 (diff)
downloadffmpeg-8ba17766a6b30db78c638b9f86b3cc57985d2006.tar.gz
avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block()
Fixes: signed integer overflow: 1795032576 + 598344192 cannot be represented in type 'int' Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5636723419119616 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 cc78783ce5e8837d4f4ca43eedf2d299651e65ff) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/truemotion2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 3443bbeda2..80a28a0ac6 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -606,7 +606,7 @@ static inline void tm2_null_res_block(TM2Context *ctx, AVFrame *pic, int bx, int
ct = ctx->D[0] + ctx->D[1] + ctx->D[2] + ctx->D[3];
if (bx > 0)
- left = last[-1] - ct;
+ left = last[-1] - (unsigned)ct;
else
left = 0;
@@ -617,7 +617,7 @@ static inline void tm2_null_res_block(TM2Context *ctx, AVFrame *pic, int bx, int
last[2] = right - (diff >> 2);
last[3] = right;
{
- int tp = left;
+ unsigned tp = left;
ctx->D[0] = (tp + (ct >> 2)) - left;
left += ctx->D[0];