aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-21 20:36:11 +0100
committerMans Rullgard <mans@mansr.com>2011-10-21 20:56:59 +0100
commit41ac093f7e315e3af17612f580c387b3688f4f43 (patch)
tree4816dd5f0a4a4a539212502ca82873c58ee95691
parent5dd35b43f1cd3dddaddaae8e2f267117b5fa2d54 (diff)
downloadffmpeg-41ac093f7e315e3af17612f580c387b3688f4f43.tar.gz
swscale: fix signed shift overflows in ff_yuv2rgb_c_init_tables()
Signed-off-by: Mans Rullgard <mans@mansr.com>
-rw-r--r--libswscale/yuv2rgb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index cad09338d3..39c8b9c6fb 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -788,8 +788,8 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int
y_table32 = c->yuvTable;
yb = -(384<<16) - oy;
for (i = 0; i < 1024; i++) {
- uint8_t yval = av_clip_uint8((yb + 0x8000) >> 16);
- y_table32[i ] = (yval << rbase) + (needAlpha ? 0 : (255 << abase));
+ unsigned yval = av_clip_uint8((yb + 0x8000) >> 16);
+ y_table32[i ] = (yval << rbase) + (needAlpha ? 0 : (255u << abase));
y_table32[i+1024] = yval << gbase;
y_table32[i+2048] = yval << bbase;
yb += cy;