Austerlitz patch #2 - Calculate the DIB size
Jason Edmeades
us at the-edmeades.demon.co.uk
Sat Feb 21 10:25:20 CST 2004
Austerlitz provides a far too small 'biSizeImage' field for uncompressed
data, but the code already handles uncompressed images by calculating
the requested size. BI_BITFIELDS is just another form of uncompressed
image, so add it into that calculation.
Changelog
Calculate the size of BI_BITFIELDS dib sections via the width and height
Jason
-------------- next part --------------
Index: dlls/x11drv/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/dib.c,v
retrieving revision 1.6
diff -u -r1.6 dib.c
--- dlls/x11drv/dib.c 20 Jan 2004 22:04:00 -0000 1.6
+++ dlls/x11drv/dib.c 21 Feb 2004 16:17:42 -0000
@@ -3913,7 +3913,9 @@
/* use the biSizeImage data as the memory size only if we're dealing with a
compressed image where the value is set. Otherwise, calculate based on
width * height */
- INT totalSize = dib->dsBmih.biSizeImage && dib->dsBmih.biCompression != BI_RGB
+ INT totalSize = dib->dsBmih.biSizeImage &&
+ (dib->dsBmih.biCompression != BI_RGB &&
+ dib->dsBmih.biCompression != BI_BITFIELDS)
? dib->dsBmih.biSizeImage
: dib->dsBm.bmWidthBytes * effHeight;
DWORD old_prot;
@@ -4532,7 +4534,7 @@
/* Get storage location for DIB bits. Only use biSizeImage if it's valid and
we're dealing with a compressed bitmap. Otherwise, use width * height. */
- totalSize = bi->biSizeImage && bi->biCompression != BI_RGB
+ totalSize = bi->biSizeImage && (bi->biCompression != BI_RGB && bi->biCompression != BI_BITFIELDS)
? bi->biSizeImage : bm.bmWidthBytes * effHeight;
if (section)
More information about the wine-patches
mailing list