diff --git a/gfx/drivers_shader/shader_gl_core.cpp b/gfx/drivers_shader/shader_gl_core.cpp index 8fbddca1fe..e3320cb5fa 100644 --- a/gfx/drivers_shader/shader_gl_core.cpp +++ b/gfx/drivers_shader/shader_gl_core.cpp @@ -93,10 +93,10 @@ static uint32_t gl_core_get_cross_compiler_target_version() unsigned patch = 0; #ifdef HAVE_OPENGLES3 - if (version && sscanf(version, "OpenGL ES %u.%u.%u", &major, &minor, &patch) < 2) + if (!version || sscanf(version, "OpenGL ES %u.%u.%u", &major, &minor, &patch) < 2) return 300u; #else - if (version && sscanf(version, "%u.%u.%u", &major, &minor, &patch) < 2) + if (!version || sscanf(version, "%u.%u.%u", &major, &minor, &patch) < 2) return 150u; #endif if (major == 3u && minor == 2u)