[clutter] actor: Check for NULL pointer for pspec



commit 4dfa4de5d01bf5817c939c23d738967e6f8922df
Author: Nitin Sharma <nitin s1 samsung com>
Date:   Mon Jul 13 17:21:57 2015 +0530

    actor: Check for NULL pointer for pspec
    
    In function clutter_actor_set_final_state, the pspec pointer returned by calling
    g_object_class_find_property is not checked for NULL.

 clutter/clutter-actor.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index e01f376..60c8527 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -15056,13 +15056,16 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
 
       pspec = g_object_class_find_property (obj_class, property_name);
 
-      if ((pspec->flags & CLUTTER_PARAM_ANIMATABLE) != 0)
+      if (pspec != NULL)
         {
-          /* XXX - I'm going to the special hell for this */
-          clutter_actor_set_animatable_property (actor, pspec->param_id, final, pspec);
+          if ((pspec->flags & CLUTTER_PARAM_ANIMATABLE) != 0)
+            {
+              /* XXX - I'm going to the special hell for this */
+              clutter_actor_set_animatable_property (actor, pspec->param_id, final, pspec);
+            }
+          else
+            g_object_set_property (G_OBJECT (animatable), pspec->name, final);
         }
-      else
-        g_object_set_property (G_OBJECT (animatable), pspec->name, final);
     }
 
   g_free (p_name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]