window-actor: Add a missing NULL-check

We shouldn't crash on a NULL-clip.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/856
This commit is contained in:
Robert Mader 2019-10-14 17:45:14 +02:00
parent a8155a0471
commit 317ce05a27

View File

@ -2183,21 +2183,25 @@ meta_window_actor_get_image (MetaWindowActor *self,
if (clutter_actor_get_n_children (actor) == 1)
{
MetaShapedTexture *stex;
MetaRectangle surface_clip;
int geometry_scale;
MetaRectangle *surface_clip = NULL;
geometry_scale =
meta_window_actor_get_geometry_scale (self);
if (clip)
{
surface_clip = (MetaRectangle) {
.x = clip->x / geometry_scale,
.y = clip->y / geometry_scale,
.width = clip->width / geometry_scale,
.height = clip->height / geometry_scale,
};
int geometry_scale;
geometry_scale =
meta_window_actor_get_geometry_scale (self);
surface_clip = g_alloca (sizeof (MetaRectangle));
surface_clip->x = clip->x / geometry_scale,
surface_clip->y = clip->y / geometry_scale;
surface_clip->width = clip->width / geometry_scale;
surface_clip->height = clip->height / geometry_scale;
}
stex = meta_surface_actor_get_texture (priv->surface);
return meta_shaped_texture_get_image (stex, &surface_clip);
return meta_shaped_texture_get_image (stex, surface_clip);
}
clutter_actor_get_size (actor, &width, &height);