mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Fix segfault with a null gl context.
This commit is contained in:
parent
5611977de0
commit
46676289d4
@ -1727,6 +1727,7 @@ static void *gl_init(const video_info_t *video,
|
||||
char *error_string = NULL;
|
||||
gl_t *gl = (gl_t*)calloc(1, sizeof(gl_t));
|
||||
const gfx_ctx_driver_t *ctx_driver = gl_get_context(gl);
|
||||
|
||||
if (!gl || !ctx_driver)
|
||||
goto error;
|
||||
|
||||
@ -1782,6 +1783,9 @@ static void *gl_init(const video_info_t *video,
|
||||
RARCH_LOG("[GL]: Vendor: %s, Renderer: %s.\n", vendor, renderer);
|
||||
RARCH_LOG("[GL]: Version: %s.\n", version);
|
||||
|
||||
if (string_is_equal(ctx_driver->ident, "null"))
|
||||
goto error;
|
||||
|
||||
if (!string_is_empty(version))
|
||||
sscanf(version, "%d.%d", &gl->version_major, &gl->version_minor);
|
||||
|
||||
|
@ -38,5 +38,8 @@ void rglgen_resolve_symbols_custom(rglgen_proc_address_t proc,
|
||||
|
||||
void rglgen_resolve_symbols(rglgen_proc_address_t proc)
|
||||
{
|
||||
if (!proc)
|
||||
return;
|
||||
|
||||
rglgen_resolve_symbols_custom(proc, rglgen_symbol_map);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user