swscale/swscale: fix integer overflow

Should fix fate failure with clang ftrapv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9c0451224)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-03-24 05:01:32 +01:00
parent 2b5b21dbac
commit b8f6069bf3
1 changed files with 3 additions and 2 deletions

View File

@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
{
int i;
int32_t *dst = (int32_t *) _dst;
for (i = 0; i < width; i++)
dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12;
for (i = 0; i < width; i++) {
dst[i] = ((int)(FFMIN(dst[i], 30189 << 4) * 4769U - (39057361 << 2))) >> 12;
}
}
static void lumRangeFromJpeg16_c(int16_t *_dst, int width)