mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
compositor: Fix warning with -Wmaybe-uninitialized
Assert that the region is created, thus we passed a valid enum value to the get_scaled_region() function. Fixes: ../../../../Source/gnome/mutter/src/compositor/meta-surface-actor.c: In function ‘get_scaled_region’: ../../../../Source/gnome/mutter/src/compositor/meta-surface-actor.c:113:10: warning: ‘scaled_region’ may be used uninitialized in this function [-Wmaybe-uninitialized] 113 | return scaled_region; | ^~~~~~~~~~~~~ Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1624>
This commit is contained in:
parent
14ab90eeba
commit
745ccc5b01
@ -83,7 +83,7 @@ get_scaled_region (MetaSurfaceActor *surface_actor,
|
||||
ScalePerspectiveType scale_perspective)
|
||||
{
|
||||
MetaWindowActor *window_actor;
|
||||
cairo_region_t *scaled_region;
|
||||
cairo_region_t *scaled_region = NULL;
|
||||
int geometry_scale;
|
||||
float x, y;
|
||||
|
||||
@ -107,6 +107,7 @@ get_scaled_region (MetaSurfaceActor *surface_actor,
|
||||
break;
|
||||
}
|
||||
|
||||
g_assert (scaled_region != NULL);
|
||||
cairo_region_translate (region, -x, -y);
|
||||
cairo_region_translate (scaled_region, -x, -y);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user