[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug in Imlib11



Hi all

I have found a bug in Imlib11 (1.9.14-17), on pure64 and gcc-3.4
The problem is that they are using long ints for loading the bmp header, the 
size of long int is 8bytes in amd64 and 4bytes in i386, this is causing 
kuickshow (and others) being unable to display bmps.

i have fixed it changing a few lines in imlib-1.9.14/Imlib/load.c

line 626:

-  fread(dbuf, 4, 4, file);
-
-  size = dbuf[0];
-  offset = dbuf[2];
-
-  fread(dbuf, 4, 2, file);
-  *w = (int)dbuf[0];
-  *h = (int)dbuf[1];

+  fread(dbuf, 4, 2, file);
+  size = (int)dbuf[0];
+  fread(dbuf, 4, 2, file);
+  offset = (int)dbuf[0];
+
+  fread(dbuf, 4, 1, file);
+  *w = (int)dbuf[0];
+  fread(dbuf, 4, 1, file);
+  *h = (int)dbuf[0];


I hope this can help.



Reply to: