[actor] Check out parameters before setting them

The clutter_actor_get_rotation() out parameters may be NULL, so
we need to check before dereferencing them.
This commit is contained in:
Emmanuele Bassi 2009-02-11 17:56:22 +00:00
parent 82db27874b
commit 402e022c36

View File

@ -2617,7 +2617,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_double ("rotation-angle-x",
"Rotation Angle X",
"The rotation angle on the X axis",
0.0,
-G_MAXDOUBLE,
G_MAXDOUBLE,
0.0,
CLUTTER_PARAM_READWRITE));
@ -2634,7 +2634,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_double ("rotation-angle-y",
"Rotation Angle Y",
"The rotation angle on the Y axis",
0.0,
-G_MAXDOUBLE,
G_MAXDOUBLE,
0.0,
CLUTTER_PARAM_READWRITE));
@ -2651,7 +2651,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_param_spec_double ("rotation-angle-z",
"Rotation Angle Z",
"The rotation angle on the Z axis",
0.0,
-G_MAXDOUBLE,
G_MAXDOUBLE,
0.0,
CLUTTER_PARAM_READWRITE));
@ -5803,8 +5803,13 @@ clutter_actor_get_rotation (ClutterActor *self,
angle = clutter_actor_get_rotationu (self, axis, &xu, &yu, &zu);
if (x)
*x = CLUTTER_UNITS_TO_DEVICE (xu);
if (y)
*y = CLUTTER_UNITS_TO_DEVICE (yu);
if (z)
*z = CLUTTER_UNITS_TO_DEVICE (zu);
return angle;