[cairo-commit] cairo/src cairo-win32-surface.c,1.34.2.1,1.34.2.2

Tim Rowley commit at pdx.freedesktop.org
Tue Sep 27 13:25:08 PDT 2005


Committed by: tor

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv4088/src

Modified Files:
      Tag: BRANCH_1_0
	cairo-win32-surface.c 
Log Message:
	Bug #4602, reviewed by cworth.
	
	* src/cairo-win32-surface.c (_create_dc_and_bitmap):
	Avoid creating size-0 bitmap, which fails.


Index: cairo-win32-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-surface.c,v
retrieving revision 1.34.2.1
retrieving revision 1.34.2.2
diff -u -d -r1.34.2.1 -r1.34.2.2
--- cairo-win32-surface.c	19 Sep 2005 21:28:39 -0000	1.34.2.1
+++ cairo-win32-surface.c	27 Sep 2005 20:25:06 -0000	1.34.2.2
@@ -124,8 +124,8 @@
     }
 
     bitmap_info->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
-    bitmap_info->bmiHeader.biWidth = width;
-    bitmap_info->bmiHeader.biHeight = - height; /* top-down */
+    bitmap_info->bmiHeader.biWidth = width == 0 ? 1 : width;
+    bitmap_info->bmiHeader.biHeight = height == 0 ? -1 : - height; /* top-down */
     bitmap_info->bmiHeader.biSizeImage = 0;
     bitmap_info->bmiHeader.biXPelsPerMeter = 72. / 0.0254; /* unused here */
     bitmap_info->bmiHeader.biYPelsPerMeter = 72. / 0.0254; /* unused here */



More information about the cairo-commit mailing list