clutter: Move priv variable initialization after precondition checks

In case of misuse (e.g. passing NULL stage) this might result in crashes
before the precondition checks managed to kick in. Move this priv variable
initialization after these checks.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2099>
This commit is contained in:
Carlos Garnacho 2022-01-16 18:00:35 +01:00 committed by Marge Bot
parent a840c039a0
commit d51469ea2a

View File

@ -3787,12 +3787,14 @@ ClutterGrab *
clutter_stage_grab (ClutterStage *stage,
ClutterActor *actor)
{
ClutterStagePrivate *priv = stage->priv;
ClutterStagePrivate *priv;
ClutterGrab *grab;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
priv = stage->priv;
if (!priv->topmost_grab)
{
ClutterMainContext *context;