mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
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 cc78783ce5
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4b2c2d787c
commit
d35b7197dd
@ -598,7 +598,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];
|
ct = ctx->D[0] + ctx->D[1] + ctx->D[2] + ctx->D[3];
|
||||||
|
|
||||||
if (bx > 0)
|
if (bx > 0)
|
||||||
left = last[-1] - ct;
|
left = last[-1] - (unsigned)ct;
|
||||||
else
|
else
|
||||||
left = 0;
|
left = 0;
|
||||||
|
|
||||||
@ -609,7 +609,7 @@ static inline void tm2_null_res_block(TM2Context *ctx, AVFrame *pic, int bx, int
|
|||||||
last[2] = right - (diff >> 2);
|
last[2] = right - (diff >> 2);
|
||||||
last[3] = right;
|
last[3] = right;
|
||||||
{
|
{
|
||||||
int tp = left;
|
unsigned tp = left;
|
||||||
|
|
||||||
ctx->D[0] = (tp + (ct >> 2)) - left;
|
ctx->D[0] = (tp + (ct >> 2)) - left;
|
||||||
left += ctx->D[0];
|
left += ctx->D[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user