added paranoid NULL check

This commit is contained in:
LazyBumHorse 2019-05-25 13:10:13 +02:00 committed by GitHub
parent 662b473e9f
commit 9894f48fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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