mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-27 06:11:51 +00:00
gl: Silence a possible null dereference warning
This commit is contained in:
parent
ac3edc79e3
commit
085a74d33f
14
gfx/gl.c
14
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user