Commit e3fadc57 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000: Fixes integer overflow in ff_jpeg2000_ceildivpow2()

Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 2231/clusterfuzz-testcase-minimized-4565181982048256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 611b3562
......@@ -215,7 +215,7 @@ typedef struct Jpeg2000Component {
/* misc tools */
static inline int ff_jpeg2000_ceildivpow2(int a, int b)
{
return -(((int64_t)(-a)) >> b);
return -((-(int64_t)a) >> b);
}
static inline int ff_jpeg2000_ceildiv(int a, int b)
......
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