aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-24 05:01:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 18:16:20 +0200
commit1be06c853182f9b691efe8df5ab3653d54cdd5b9 (patch)
tree2e8bf882dd17ff97eb658d66c01252b86c4cc95a
parent6011b806dd5d608a52df9cb1956e1dd099058687 (diff)
downloadffmpeg-1be06c853182f9b691efe8df5ab3653d54cdd5b9.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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index bb908191dc..bff610d709 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)