[cairo-commit] src/win32
Bryce Harrington
bryce at kemper.freedesktop.org
Mon Feb 2 16:44:13 PST 2015
src/win32/cairo-win32-display-surface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 91f128bf7a1233a7fc2e164f95279987e32a3532
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date: Wed Sep 11 18:10:38 2013 +0200
win32: Fix crash from win32 surface's image size too small
Beginning in 1.12, a crash can occur when the win32 surface's image size
does not cover the entire surface (e.g. due to clipping regions).
This patch enlarges the fallback surface created of the amount
necessary not to write past the end of the DIB. It assumes that
Clip applied to an HDC are clamped to (0,0,width,height) of the HDC.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53121
Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 5ecdbee..965f2c4 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -455,17 +455,17 @@ _cairo_win32_display_surface_map_to_image (void *abstract_sur
surface->fallback =
_cairo_win32_display_surface_create_for_dc (surface->win32.dc,
surface->win32.format,
- surface->win32.extents.width,
- surface->win32.extents.height);
+ surface->win32.extents.x + surface->win32.extents.width,
+ surface->win32.extents.y + surface->win32.extents.height);
if (unlikely (status = surface->fallback->status))
goto err;
if (!BitBlt (to_win32_surface(surface->fallback)->dc,
- 0, 0,
+ surface->win32.extents.x, surface->win32.extents.y,
surface->win32.extents.width,
surface->win32.extents.height,
surface->win32.dc,
- 0, 0,
+ surface->win32.extents.x, surface->win32.extents.y,
SRCCOPY)) {
status = _cairo_error (CAIRO_STATUS_DEVICE_ERROR);
goto err;
More information about the cairo-commit
mailing list