Commit 4a9f466b authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Carl Eugen Hoyos

Fix alpha overflow when converting from RGBA64 to RGBA.

Fixes converting the sample from ticket #503 to 32bit RGB.
parent 409a3bda
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment