--- cairo-win32-surface.c~ 2005-09-14 12:43:00.000000000 -0500 +++ cairo-win32-surface.c 2005-09-26 17:51:35.774644800 -0500 @@ -119,18 +119,18 @@ _create_dc_and_bitmap (cairo_win32_surfa bitmap_info = malloc (sizeof (BITMAPINFOHEADER) + num_palette * sizeof (RGBQUAD)); if (!bitmap_info) return CAIRO_STATUS_NO_MEMORY; } else { bitmap_info = (BITMAPINFO *)&bmi_stack; } 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 */ bitmap_info->bmiHeader.biPlanes = 1; switch (format) { case CAIRO_FORMAT_ARGB32: case CAIRO_FORMAT_RGB24: