Commit c0220c76 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2c630d15
...@@ -249,7 +249,7 @@ enum dirac_subband { ...@@ -249,7 +249,7 @@ enum dirac_subband {
/* magic number division by 3 from schroedinger */ /* magic number division by 3 from schroedinger */
static inline int divide3(int x) 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) static DiracFrame *remove_frame(DiracFrame *framelist[], int picnum)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment