From 085a74d33f72743f2f6c6dc975a3d224ec5ece44 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 12 Sep 2014 22:41:30 -0400 Subject: [PATCH] gl: Silence a possible null dereference warning --- gfx/gl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index 0d627252a7..a81583d2fb 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -197,7 +197,7 @@ static bool check_fbo_proc(gl_t *gl) static bool gl_shader_init(gl_t *gl) { - bool ret; + bool ret = false; const gl_shader_backend_t *backend = NULL; const char *shader_path = (g_settings.video.shader_enable && *g_settings.video.shader_path) ? @@ -214,8 +214,6 @@ static bool gl_shader_init(gl_t *gl) type = gfx_shader_parse_type(shader_path, gl->core_context ? RARCH_SHADER_GLSL : DEFAULT_SHADER_TYPE); - ret = 0; - if (type == RARCH_SHADER_NONE) { RARCH_LOG("[GL]: Not loading any shader.\n"); @@ -260,12 +258,14 @@ static bool gl_shader_init(gl_t *gl) gl->shader = backend; if (gl->shader && gl->shader->init) + { ret = gl->shader->init(gl, shader_path); - if (!ret) - { - RARCH_ERR("[GL]: Failed to init shader, falling back to stock.\n"); - ret = gl->shader->init(gl, NULL); + if (!ret) + { + RARCH_ERR("[GL]: Failed to init shader, falling back to stock.\n"); + ret = gl->shader->init(gl, NULL); + } } return ret;