aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-04-07 16:44:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-04-22 00:54:06 +0200
commit49881ea3431b0d48fc9889a848b21c1c71d02263 (patch)
treeed25dcd0820f9ae3878e9b8d5449ae489ec72fba /libavcodec
parent5f7ab544b3869821bdacc8e7339a03e97ca7dec7 (diff)
downloadffmpeg-49881ea3431b0d48fc9889a848b21c1c71d02263.tar.gz
avcodec/diracdec: Use 64bit in intermediate of global motion vector field generation
It seems the specification does not limit the value to 32bit Fixes: signed integer overflow: -109611143 * 24 cannot be represented in type 'int' Fixes: 13477/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5648337460527104 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 837820f385af699f9bee5e2ba3169dda15e5894d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/diracdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index d99f8bed77..f1a34703a7 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1403,7 +1403,7 @@ static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref)
int *b = s->globalmc[ref].pan_tilt;
int *c = s->globalmc[ref].perspective;
- int m = (1<<ep) - (c[0]*x + c[1]*y);
+ int64_t m = (1<<ep) - (c[0]*(int64_t)x + c[1]*(int64_t)y);
int64_t mx = m * (int64_t)((A[0][0] * (int64_t)x + A[0][1]*(int64_t)y) + (1<<ez) * b[0]);
int64_t my = m * (int64_t)((A[1][0] * (int64_t)x + A[1][1]*(int64_t)y) + (1<<ez) * b[1]);