x11: Account for variable being possibly NULL

We might end up with a NULL opaque_region here in some circumstances
(client deleted _NET_WM_OPAQUE_REGION, or passed invalid data or a
region with 0 rectangles), account for that when freeing the variable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2758>
This commit is contained in:
Carlos Garnacho 2022-12-16 19:00:22 +01:00
parent 2b6651327e
commit c6c7f310d8

View File

@ -715,7 +715,7 @@ reload_opaque_region (MetaWindow *window,
else if (window->frame && value->source_xwindow == window->frame->xwindow) else if (window->frame && value->source_xwindow == window->frame->xwindow)
meta_frame_set_opaque_region (window->frame, opaque_region); meta_frame_set_opaque_region (window->frame, opaque_region);
cairo_region_destroy (opaque_region); g_clear_pointer (&opaque_region, cairo_region_destroy);
} }
static void static void