diff options
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 8 | ||||
-rw-r--r-- | gdk-pixbuf/io-bmp.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index ffeeb1892e..34968425dd 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,11 @@ +2009-01-19 Tor Lillqvist <tml@iki.fi> + + Bug 568305 - gdk-pixbuf mishandles BI_BITFIELDS bmps + + * io-bmp.c (OneLine32): Use unsigned variables so that we can + right-shift them without risk of sign extension. Don't "reverse" + the alpha value, actually storing 0xFF-alpha, but use it as such. + 2009-01-12 Tor Lillqvist <tml@iki.fi> Bug 164002 - query scripts don't work uninstalled on windows diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c index bdb856eea1..21300e45d8 100644 --- a/gdk-pixbuf/io-bmp.c +++ b/gdk-pixbuf/io-bmp.c @@ -762,7 +762,7 @@ static void OneLine32(struct bmp_progressive_state *context) a_rshift = context->a_bits - a_lshift; for (i = 0; i < context->Header.width; i++) { - int v, r, g, b, a; + unsigned int v, r, g, b, a; v = src[0] | (src[1] << 8) | (src[2] << 16) | (src[3] << 24); @@ -775,7 +775,7 @@ static void OneLine32(struct bmp_progressive_state *context) *pixels++ = (g << g_lshift) | (g >> g_rshift); *pixels++ = (b << b_lshift) | (b >> b_rshift); if (context->a_bits) - *pixels++ = 0xff - ((a << a_lshift) | (a >> a_rshift)); + *pixels++ = (a << a_lshift) | (a >> a_rshift); else *pixels++ = 0xff; |