mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
Fix segfault on invalid graphics context driver
Last element of gfx_ctx_drivers[] is NULL, don't dereference it.
This commit is contained in:
parent
665a56b0b4
commit
b5bd6f8d20
@ -77,7 +77,7 @@ const gfx_ctx_driver_t *gfx_ctx_find_driver(const char *ident)
|
||||
unsigned i;
|
||||
for (i = 0; i < ARRAY_SIZE(gfx_ctx_drivers); i++)
|
||||
{
|
||||
if (strcmp(gfx_ctx_drivers[i]->ident, ident) == 0)
|
||||
if (gfx_ctx_drivers[i] && strcmp(gfx_ctx_drivers[i]->ident, ident) == 0)
|
||||
return gfx_ctx_drivers[i];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user