]> Pileus Git - ~andy/gtk/commitdiff
Properly determine the number of colors in an OS/2 BMP file. (#150003,
authorMatthias Clasen <maclas@gmx.de>
Fri, 13 Aug 2004 02:26:57 +0000 (02:26 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Fri, 13 Aug 2004 02:26:57 +0000 (02:26 +0000)
Thu Aug 12 22:19:12 2004  Matthias Clasen  <maclas@gmx.de>

* io-bmp.c (DecodeHeader): Properly determine the number of
colors in an OS/2 BMP file.  (#150003, Jon-Kare Hellan)

gdk-pixbuf/ChangeLog
gdk-pixbuf/io-bmp.c

index d57d37283187f40b08dec1fdeb6075738863d9be..8ce859d84d4afa6f04f3a723b2f45267f03d4ca3 100644 (file)
@@ -1,3 +1,8 @@
+Thu Aug 12 22:19:12 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * io-bmp.c (DecodeHeader): Properly determine the number of 
+       colors in an OS/2 BMP file.  (#150003, Jon-Kare Hellan)
+
 2004-08-12  Matthias Clasen  <mclasen@redhat.com>
 
        * pixops/pixops.c: Remove C99-isms.  (#149967, Vincent Noel)
index d79e5be03c7726c9d5f5f935148283d923ba9493..82ddba1301a6491fb1381a49a30553b1101a8b86 100644 (file)
@@ -269,7 +269,11 @@ static gboolean DecodeHeader(unsigned char *BFH, unsigned char *BIH,
                return FALSE;
        }
 
-       clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
+       if (State->Header.size == 12)
+               clrUsed = 1 << State->Header.depth;
+       else
+               clrUsed = (int) (BIH[35] << 24) + (BIH[34] << 16) + (BIH[33] << 8) + (BIH[32]);
+
        if (clrUsed != 0)
                State->Header.n_colors = clrUsed;
        else