Commit c9c04512 authored by Michael Niedermayer's avatar Michael Niedermayer

swscale/swscale: fix integer overflow

Should fix fate failure with clang ftrapv
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8683fa54
...@@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width) ...@@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
{ {
int i; int i;
int32_t *dst = (int32_t *) _dst; int32_t *dst = (int32_t *) _dst;
for (i = 0; i < width; i++) for (i = 0; i < width; i++) {
dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12; dst[i] = ((int)(FFMIN(dst[i], 30189 << 4) * 4769U - (39057361 << 2))) >> 12;
}
} }
static void lumRangeFromJpeg16_c(int16_t *_dst, int width) static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
......
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