diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-07-28 00:49:27 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-07-29 15:23:26 +0300 |
commit | 95bbbbd14e44ef4c1a1589d1c1dc39245dc72a39 (patch) | |
tree | e71a61e76a6f6fec81178eab688f23cafbfc3519 | |
parent | 406d9fdd135789fc97a40e1f316a6f9d7079a452 (diff) |
avcodec/diracdec: Fix integer overflow in divide3()
Fixes: runtime error: signed integer overflow: -1073746548 * 21845 cannot be represented in type 'int'
Fixes: 2729/clusterfuzz-testcase-minimized-5902915464069120
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 c0220c768c7fc933a76c863ebbb0abdf68a88533)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/diracdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 929832b9ce..a718f00992 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -285,7 +285,7 @@ static const int qoffset_inter_tab[MAX_QUANT+1] = { /* magic number division by 3 from schroedinger */ static inline int divide3(int x) { - return ((x+1)*21845 + 10922) >> 16; + return (int)((x+1U)*21845 + 10922) >> 16; } static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum) |