[clutter] script: Fix a segfault
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] script: Fix a segfault
- Date: Tue, 17 Jan 2012 14:31:28 +0000 (UTC)
commit 9f0ba2da0fece26167b3b2a44f3eb00ef1202702
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Tue Jan 17 14:17:20 2012 +0000
script: Fix a segfault
Accessing a variable before it is being set is not a great plan.
clutter/clutter-script-parser.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c
index 8fa7ddd..2814c3a 100644
--- a/clutter/clutter-script-parser.c
+++ b/clutter/clutter-script-parser.c
@@ -2000,7 +2000,7 @@ _clutter_script_construct_object (ClutterScript *script,
else
{
GList *properties = oinfo->properties;
- GParameter *parameters = (GParameter *) (void *) params->data;
+ GParameter *parameters;
/* every other object: first, we get the construction parameters */
oinfo->properties =
@@ -2010,6 +2010,7 @@ _clutter_script_construct_object (ClutterScript *script,
properties,
¶ms);
+ parameters = (GParameter *) (void *) params->data;
oinfo->object = g_object_newv (oinfo->gtype,
params->len,
parameters);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]