mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 02:20:43 -05:00
[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:
parent
82db27874b
commit
402e022c36
@ -2617,7 +2617,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
g_param_spec_double ("rotation-angle-x",
|
g_param_spec_double ("rotation-angle-x",
|
||||||
"Rotation Angle X",
|
"Rotation Angle X",
|
||||||
"The rotation angle on the X axis",
|
"The rotation angle on the X axis",
|
||||||
0.0,
|
-G_MAXDOUBLE,
|
||||||
G_MAXDOUBLE,
|
G_MAXDOUBLE,
|
||||||
0.0,
|
0.0,
|
||||||
CLUTTER_PARAM_READWRITE));
|
CLUTTER_PARAM_READWRITE));
|
||||||
@ -2634,7 +2634,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
g_param_spec_double ("rotation-angle-y",
|
g_param_spec_double ("rotation-angle-y",
|
||||||
"Rotation Angle Y",
|
"Rotation Angle Y",
|
||||||
"The rotation angle on the Y axis",
|
"The rotation angle on the Y axis",
|
||||||
0.0,
|
-G_MAXDOUBLE,
|
||||||
G_MAXDOUBLE,
|
G_MAXDOUBLE,
|
||||||
0.0,
|
0.0,
|
||||||
CLUTTER_PARAM_READWRITE));
|
CLUTTER_PARAM_READWRITE));
|
||||||
@ -2651,7 +2651,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
|
|||||||
g_param_spec_double ("rotation-angle-z",
|
g_param_spec_double ("rotation-angle-z",
|
||||||
"Rotation Angle Z",
|
"Rotation Angle Z",
|
||||||
"The rotation angle on the Z axis",
|
"The rotation angle on the Z axis",
|
||||||
0.0,
|
-G_MAXDOUBLE,
|
||||||
G_MAXDOUBLE,
|
G_MAXDOUBLE,
|
||||||
0.0,
|
0.0,
|
||||||
CLUTTER_PARAM_READWRITE));
|
CLUTTER_PARAM_READWRITE));
|
||||||
@ -5803,8 +5803,13 @@ clutter_actor_get_rotation (ClutterActor *self,
|
|||||||
|
|
||||||
angle = clutter_actor_get_rotationu (self, axis, &xu, &yu, &zu);
|
angle = clutter_actor_get_rotationu (self, axis, &xu, &yu, &zu);
|
||||||
|
|
||||||
|
if (x)
|
||||||
*x = CLUTTER_UNITS_TO_DEVICE (xu);
|
*x = CLUTTER_UNITS_TO_DEVICE (xu);
|
||||||
|
|
||||||
|
if (y)
|
||||||
*y = CLUTTER_UNITS_TO_DEVICE (yu);
|
*y = CLUTTER_UNITS_TO_DEVICE (yu);
|
||||||
|
|
||||||
|
if (z)
|
||||||
*z = CLUTTER_UNITS_TO_DEVICE (zu);
|
*z = CLUTTER_UNITS_TO_DEVICE (zu);
|
||||||
|
|
||||||
return angle;
|
return angle;
|
||||||
|
Loading…
Reference in New Issue
Block a user