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@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47605
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-03-20 19:14:28 +00:00
parent 0a778d974f
commit 86a89a8c1d

View file

@ -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;