Cherry-pick https://gitlab.freedesktop.org/cairo/cairo/-/commit/44f808fce9f437e14f2b0ef4e1583def8ab578ae draft
authorJonathan Kew <jkew@mozilla.com>
Mon, 08 Feb 2021 12:25:24 +0000
changeset 3667294 8044ee0cbfe079e17168b3dd62037ae0541086ab
parent 3667293 e9a66ece00f85a97abc1a63215a9157e41e37939
child 3667295 4e8d451ba163afe55b830f63e9005bb78361d23f
push id683063
push userjkew@mozilla.com
push dateMon, 19 Apr 2021 13:15:26 +0000
treeherdertry@919daaf50d14 [default view] [failures only]
milestone89.0a1
Cherry-pick https://gitlab.freedesktop.org/cairo/cairo/-/commit/44f808fce9f437e14f2b0ef4e1583def8ab578ae Avoid a use-after-scope
gfx/cairo/cairo/src/cairo-spans-compositor.c
--- a/gfx/cairo/cairo/src/cairo-spans-compositor.c
+++ b/gfx/cairo/cairo/src/cairo-spans-compositor.c
@@ -1036,25 +1036,25 @@ static cairo_int_status_t
 								&boxes);
 	if (likely (status == CAIRO_INT_STATUS_SUCCESS))
 	    status = clip_and_composite_boxes (compositor, extents, &boxes);
 	_cairo_boxes_fini (&boxes);
     }
 
     if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
 	cairo_polygon_t polygon;
+	cairo_box_t limits;
 	cairo_fill_rule_t fill_rule = CAIRO_FILL_RULE_WINDING;
 
 	if (! _cairo_rectangle_contains_rectangle (&extents->unbounded,
 						   &extents->mask))
 	{
 	    if (extents->clip->num_boxes == 1) {
 		_cairo_polygon_init (&polygon, extents->clip->boxes, 1);
 	    } else {
-		cairo_box_t limits;
 		_cairo_box_from_rectangle (&limits, &extents->unbounded);
 		_cairo_polygon_init (&polygon, &limits, 1);
 	    }
 	}
 	else
 	{
 	    _cairo_polygon_init (&polygon, NULL, 0);
 	}