From d51469ea2a9c41a1c332ede2686ff9e111064284 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 16 Jan 2022 18:00:35 +0100 Subject: [PATCH] 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: --- clutter/clutter/clutter-stage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index de3315b42..6503f973b 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -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;