mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 03:28:27 +00:00
swscale/swscale: Use unsigned operation to avoid undefined behavior
I have not checked that the constant is correct, this just fixes the undefined behavior Fixes: signed integer overflow: -646656 * 3517 cannot be represented in type 'int Fixes: 70559/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-5209368631508992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
334c81541d
commit
e1d4f61ecc
@ -224,7 +224,7 @@ static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
|
||||
int i;
|
||||
int32_t *dst = (int32_t *) _dst;
|
||||
for (i = 0; i < width; i++)
|
||||
dst[i] = (dst[i]*(14071/4) + (33561947<<4)/4)>>12;
|
||||
dst[i] = ((int)(dst[i]*(14071U/4) + (33561947<<4)/4)) >> 12;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user