summaryrefslogtreecommitdiff
path: root/src
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 /src
parent4b1fca82a877df391b47638b3f00f1c44873c82c (diff)
Bug #4602, reviewed by cworth.
Avoid creating size-0 bitmap, which fails.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-win32-surface.c4
1 files changed, 2 insertions, 2 deletions
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 */