evas/vector : Fixed crash in evas_vg_render function. 39/43239/1
authorSubhransu Sekhar Mohanty <sub.mohanty@samsung.com>
Tue, 3 Feb 2015 05:30:11 +0000 (14:30 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Wed, 8 Jul 2015 02:07:15 +0000 (11:07 +0900)
Change-Id: I258d8d3ca15736849cf1588c06268a8e928c5ccf

src/lib/evas/canvas/evas_object_vg.c

index c8348c1307f240fefc89cd7897f42b6c017946f6..dc5db241de5a428d3344872e125edb76f942823f 100644 (file)
@@ -116,26 +116,28 @@ _evas_vg_eo_base_constructor(Eo *eo_obj, Evas_VG_Data *pd)
 
 static void
 _evas_vg_render(Evas_Object_Protected_Data *obj,
-                void *output, void *context, void *surface, Evas_VG_Node *n,
+                void *output, void *context, void *surface, Evas_VG_Node *node,
                 Eina_Array *clips, int x, int y, Eina_Bool do_async)
 {
-   Evas_VG_Container_Data *vd = eo_data_scope_get(n, EVAS_VG_CONTAINER_CLASS);
-
-   if (vd)
+    // FIXME if the class is not container ,
+    // some times its returning garbage container data.
+    if (eo_isa(node, EVAS_VG_CONTAINER_CLASS))
      {
+        Evas_VG_Container_Data *cd = eo_data_scope_get(node,
+                                                       EVAS_VG_CONTAINER_CLASS);
         Evas_VG_Node *child;
         Eina_List *l;
 
-        EINA_LIST_FOREACH(vd->children, l, child)
-          _evas_vg_render(obj,
-                          output, context, surface, child,
-                          clips, x, y, do_async);
+        EINA_LIST_FOREACH(cd->children, l, child)
+           _evas_vg_render(obj, output, context, surface, child, clips, x, y,
+                           do_async);
      }
    else
      {
-        Evas_VG_Node_Data *nd = eo_data_scope_get(n, EVAS_VG_NODE_CLASS);
-
-        obj->layer->evas->engine.func->ector_draw(output, context, surface, nd->renderer, clips, x, y, do_async);
+        Evas_VG_Node_Data *nd = eo_data_scope_get(node, EVAS_VG_NODE_CLASS);
+        obj->layer->evas->engine.func->ector_draw(output, context, surface,
+                                                  nd->renderer, clips, x, y,
+                                                  do_async);
      }
 }