aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-04 13:42:16 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-03-04 13:42:16 +0100
commit4a9f466b997e0c44d1e304a7a9c5d5de0b0868c7 (patch)
treee39fcdf41c2ec09f1158049e3827b30d8f55b39a /libswscale/output.c
parent409a3bda07dcff8c5d2672f4d89e61fddbd6f40e (diff)
downloadffmpeg-4a9f466b997e0c44d1e304a7a9c5d5de0b0868c7.tar.gz
Fix alpha overflow when converting from RGBA64 to RGBA.
Fixes converting the sample from ticket #503 to 32bit RGB.
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index cae2c31805..de41f778d2 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1040,8 +1040,8 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
*b = c->table_bU[U + YUVRGB_TABLE_HEADROOM];
if (hasAlpha) {
- A1 = (abuf0[i * 2 ] + 64) >> 7;
- A2 = (abuf0[i * 2 + 1] + 64) >> 7;
+ A1 = abuf0[i * 2 ] * 255 + 16384 >> 15;
+ A2 = abuf0[i * 2 + 1] * 255 + 16384 >> 15;
}
yuv2rgb_write(dest, i, Y1, Y2, hasAlpha ? A1 : 0, hasAlpha ? A2 : 0,