set_paths_redirect - prevent crash

This commit is contained in:
twinaphex 2015-06-14 17:25:32 +02:00
parent 9a2ca8cc9c
commit 90b918e7ee

View File

@ -310,7 +310,9 @@ void set_paths_redirect(const char *path)
{
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
uint32_t global_library_name_hash = global ? djb2_calculate(global->system.info.library_name) : 0;
uint32_t global_library_name_hash = ((global && global->system.info.library_name &&
(global->system.info.library_name[0] != '\0'))
? djb2_calculate(global->system.info.library_name) : 0);
if(
global_library_name_hash != 0 &&