[cairo-commit] src/win32

Chris Wilson ickle at kemper.freedesktop.org
Tue Mar 20 12:17:13 PDT 2012


 src/win32/cairo-win32-display-surface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 86a89a8c1de88f279b306ac8e3461773895aa7a2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Mar 20 19:14:28 2012 +0000

    win32: Check for damage before blitting
    
    During the surface flush, we reduce any pending damage and then blit. If
    no damage had been accrued then the damage->region would be NULL leading
    to a segfault.
    
    Patch suggested by Szuromi Gábor.
    
    Reported-by: Szuromi Gábor <kukkerman at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47605
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 43862aa..9e18f8d 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -516,7 +516,7 @@ _cairo_win32_display_surface_flush (void *abstract_surface)
 			 0, 0,
 			 SRCCOPY))
 		status = _cairo_win32_print_gdi_error (__FUNCTION__);
-	} else {
+	} else if (damage->region) {
 	    int n = cairo_region_num_rectangles (damage->region), i;
 	    for (i = 0; i < n; i++) {
 		cairo_rectangle_int_t rect;


More information about the cairo-commit mailing list