Merge pull request #1000 from lioncash/deref

gl: Silence a possible null dereference warning
This commit is contained in:
Twinaphex 2014-09-13 04:59:43 +02:00
commit d075bbf349

View File

@ -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;