evas-gl-x11: Fix dereference before null check

Summary: This fixes Coverity CID1293519 where einfo was being used
Before it was being null checked (which Could have caused a crash if
in fact einfo Was NULL).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-04-12 21:04:10 -04:00
parent 62b8c967b4
commit 2a7640cb4e
1 changed files with 9 additions and 4 deletions

View File

@ -792,16 +792,21 @@ void *
eng_best_visual_get(Evas_Engine_Info_GL_X11 *einfo)
{
Evas_GL_X11_Visual *evis;
int alpha = einfo->info.destination_alpha;
int depth_bits = einfo->depth_bits;
int stencil_bits = einfo->stencil_bits;
int msaa_samples = einfo->msaa_bits;
int alpha;
int depth_bits;
int stencil_bits;
int msaa_samples;
int config_attrs[40], i, num, idx;
Eina_Bool found;
if (!einfo) return NULL;
if (!einfo->info.display) return NULL;
alpha = einfo->info.destination_alpha;
depth_bits = einfo->depth_bits;
stencil_bits = einfo->stencil_bits;
msaa_samples = einfo->msaa_bits;
idx = _visuals_hash_index_get_from_info(einfo);
evis = eina_hash_find(_evas_gl_visuals, &idx);
if (evis)