avcodec/truemotion2: Fix several integer overflows in tm2_low_res_block()
Fixes: signed integer overflow: 1077952576 + 1355863565 cannot be represented in type 'int'
Fixes: 16196/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5679842317565952
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 2b655f55ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e1f09a8f6b
commit
5223773fd4
1 changed files with 3 additions and 3 deletions
|
|
@ -568,10 +568,10 @@ static inline void tm2_low_res_block(TM2Context *ctx, AVFrame *pic, int bx, int
|
|||
deltas[10] = GET_TOK(ctx, TM2_L_LO);
|
||||
|
||||
if (bx > 0)
|
||||
last[0] = (last[-1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3] + last[1]) >> 1;
|
||||
last[0] = (int)((unsigned)last[-1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3] + last[1]) >> 1;
|
||||
else
|
||||
last[0] = (last[1] - ctx->D[0] - ctx->D[1] - ctx->D[2] - ctx->D[3])>> 1;
|
||||
last[2] = (last[1] + last[3]) >> 1;
|
||||
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];
|
||||
ctx->D[0] = t1 >> 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue