Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-16 00:22:50 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 13:30:42 +0300
commit422d57feb2b119856f8edb29ada06ff4a8444748 (patch)
tree3c0fc9e322e09428c2311d123496cede31c7d7a5 /libavcodec/truemotion2.c
parent74836bb41b41fea3fe161cbc60ab1460e8de9cb5 (diff)
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/truemotion2.c')
-rw-r--r--libavcodec/truemotion2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c
index 6c15a5715b..5e2e808587 100644
--- a/libavcodec/truemotion2.c
+++ b/libavcodec/truemotion2.c
@@ -610,7 +610,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;
@@ -621,7 +621,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];