summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-09-27 13:25:06 +0000
committerTor Lillqvist <tml@novell.com>2005-09-27 13:25:06 +0000
commitb8a08fbea6b287563653ba935fabdb5f8c1f329b (patch)
tree25c5154880c093a8ea6078a18edaa75118ab9541
parent4b1fca82a877df391b47638b3f00f1c44873c82c (diff)
Bug #4602, reviewed by cworth.
Avoid creating size-0 bitmap, which fails.
-rw-r--r--ChangeLog7
-rw-r--r--src/cairo-win32-surface.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5504f9c3f..15c5b2c44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-09-27 T Rowley <tim.rowley@gmail.com>
+
+ Bug #4602, reviewed by cworth.
+
+ * src/cairo-win32-surface.c (_create_dc_and_bitmap):
+ Avoid creating size-0 bitmap, which fails.
+
2005-09-27 Carl Worth <cworth@cworth.org>
* ROADMAP: Note that bug #4409 (Dashes are missing initial caps)
diff --git a/src/cairo-win32-surface.c b/src/cairo-win32-surface.c
index 82dd4ffa1..13d6b3401 100644
--- a/src/cairo-win32-surface.c
+++ b/src/cairo-win32-surface.c
@@ -124,8 +124,8 @@ _create_dc_and_bitmap (cairo_win32_surface_t *surface,
}
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 */