evas: fix possible accsess to NULL pointer in Evas.Canvas3d.
authorOleksandr Shcherbina <o.shcherbina@samsung.com>
Mon, 23 Nov 2015 07:15:41 +0000 (08:15 +0100)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 23 Nov 2015 07:16:12 +0000 (08:16 +0100)
Summary:
@fix
CID:1339784

Reviewers: raster, cedric

Reviewed By: cedric

Differential Revision: https://phab.enlightenment.org/D3348

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/evas/canvas/evas_canvas3d_mesh.c

index f6d91f1..ead3da0 100644 (file)
@@ -1132,6 +1132,13 @@ _evas_canvas3d_mesh_convex_hull_data_get(Eo *obj EINA_UNUSED, Evas_Canvas3D_Mesh
    int stride;
 
    Evas_Canvas3D_Mesh_Frame *f = evas_canvas3d_mesh_frame_find(pd, frame);
+
+   if (!f)
+     {
+        ERR("Not existing mesh frame %d %s", __LINE__, __FILE__);
+        return;
+     }
+
    if (f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].stride != 0)
      stride = f->vertices[EVAS_CANVAS3D_VERTEX_ATTRIB_POSITION].stride / sizeof(float);
    else