diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-24 05:01:32 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-27 11:20:56 +0100 |
commit | a80a7131d11af69d2519377b35b58d8c8b3430af (patch) | |
tree | f13439ed6a4f2c2cd1154ad0d62ca242e0120097 | |
parent | 3ab63abbd47156ed53994b3aaffbcc27a36d5f5b (diff) | |
download | ffmpeg-a80a7131d11af69d2519377b35b58d8c8b3430af.tar.gz |
swscale/swscale: fix integer overflow
Should fix fate failure with clang ftrapv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9c0451224fd7bc38b4e135e99f114f80c1ae67f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libswscale/swscale.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 1d623e77a2..f529331f0f 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -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) |