summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-12-22 06:19:38 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-12-22 06:19:38 +0000
commit030a61a931cef2a9bf756d80e00753dc8c7d621a (patch)
tree95e076db416d03b1d3ddbe335776ee603f53d70f /gdk-pixbuf
parent21e120cc4424b2c395aeb3b12a8e93896029f070 (diff)
downloadgdk-pixbuf-030a61a931cef2a9bf756d80e00753dc8c7d621a.tar.gz
Handle bmps with more than 8 bits per channel. (#172584, David Costanzo)
2006-12-22 Matthias Clasen <mclasen@redhat.com> * io-bmp.c (decode_bitmasks): Handle bmps with more than 8 bits per channel. (#172584, David Costanzo)
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog4
-rw-r--r--gdk-pixbuf/io-bmp.c17
2 files changed, 21 insertions, 0 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 9fb0e1e4c..81cb1cff7 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,5 +1,9 @@
2006-12-22 Matthias Clasen <mclasen@redhat.com>
+ * io-bmp.c (decode_bitmasks): Handle bmps
+ with more than 8 bits per channel. (#172584,
+ David Costanzo)
+
* io-bmp.c: Handle offsets more carefully. (#172188,
David Costanzo)
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c
index 83e189d6e..13d973801 100644
--- a/gdk-pixbuf/io-bmp.c
+++ b/gdk-pixbuf/io-bmp.c
@@ -605,6 +605,23 @@ decode_bitmasks (guchar *buf,
}
}
+ if (State->r_bits > 8) {
+ State->r_shift += State->r_bits - 8;
+ State->r_bits = 8;
+ }
+ if (State->g_bits > 8) {
+ State->g_shift += State->g_bits - 8;
+ State->g_bits = 8;
+ }
+ if (State->b_bits > 8) {
+ State->b_shift += State->b_bits - 8;
+ State->b_bits = 8;
+ }
+ if (State->a_bits > 8) {
+ State->a_shift += State->a_bits - 8;
+ State->a_bits = 8;
+ }
+
State->read_state = READ_STATE_DATA;
State->BufferDone = 0;
State->BufferSize = State->LineWidth;