From 40247decd383db7322a9ed42e3cda7706e87ebc8 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 29 Oct 2014 12:12:39 -0400 Subject: [PATCH] evas-gl-3d: Fix compiler warning about 'ld' may be used uninitialized Summary: This commit fixes compiler warning: modules/evas/engines/gl_common/evas_gl_3d.c:1322:48: warning: 'ld' may be used uninitialized in this function [-Wmaybe-uninitialized]. We declare 'ld' as NULL now, and check it is valid before using it. @fix Signed-off-by: Chris Michael --- src/modules/evas/engines/gl_common/evas_gl_3d.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_3d.c b/src/modules/evas/engines/gl_common/evas_gl_3d.c index 36d301aa53..a5e0a81d79 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_3d.c +++ b/src/modules/evas/engines/gl_common/evas_gl_3d.c @@ -1283,7 +1283,7 @@ e3d_drawable_scene_render(E3D_Drawable *drawable, E3D_Renderer *renderer, Evas_3 const Evas_Mat4 *matrix_eye; Evas_3D_Node *light; Evas_Mat4 matrix_light_eye; - Evas_3D_Light_Data *ld; + Evas_3D_Light_Data *ld = NULL; Evas_3D_Node_Data *pd_light_node; /* Get eye matrix. */ @@ -1319,8 +1319,9 @@ e3d_drawable_scene_render(E3D_Drawable *drawable, E3D_Renderer *renderer, Evas_3 { evas_mat4_multiply(&matrix_mv, &matrix_light_eye, &pd_mesh_node->data.mesh.matrix_local_to_world); - evas_mat4_multiply(&matrix_light, &ld->projection, - &matrix_mv); + if (ld) + evas_mat4_multiply(&matrix_light, &ld->projection, + &matrix_mv); } evas_mat4_multiply(&matrix_mv, matrix_eye, &pd_mesh_node->data.mesh.matrix_local_to_world);