From 77aac45db742ed6dd5072d6296ac265ad11e496c Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Wed, 19 Oct 2022 14:59:45 +0100 Subject: [PATCH] Ensure pbounds.size is initialized even in EXTEND_NONE mode. Since the if/else was replaced by a switch() here in https://gitlab.freedesktop.org/cairo/cairo/-/commit/2e0075e265155ff144ced23ff87c4bed4cdfbc27, the size field of pbounds is not being set in the EXTEND_NONE case, which means we end up passing uninitialized values to CGPatternCreate. --- src/cairo-quartz-surface.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cairo-quartz-surface.c b/src/cairo-quartz-surface.c index 6676dc960..4cb8d04d9 100644 --- a/src/cairo-quartz-surface.c +++ b/src/cairo-quartz-surface.c @@ -901,7 +901,7 @@ _cairo_quartz_cairo_repeating_surface_pattern_to_quartz (cairo_quartz_surface_t switch (spattern->base.extend) { case CAIRO_EXTEND_NONE: - break; + case CAIRO_EXTEND_PAD: case CAIRO_EXTEND_REPEAT: pbounds.size.width = extents.width; pbounds.size.height = extents.height; @@ -911,10 +911,6 @@ _cairo_quartz_cairo_repeating_surface_pattern_to_quartz (cairo_quartz_surface_t pbounds.size.height = 2.0 * extents.height; info->do_reflect = TRUE; break; - case CAIRO_EXTEND_PAD: - pbounds.size.width = extents.width; - pbounds.size.height = extents.height; - break; } rw = pbounds.size.width; rh = pbounds.size.height;