Merge pull request #11527 from crystalct/master

fix segmentation fault on PS3 when Load State
This commit is contained in:
Autechre 2020-11-07 03:50:05 +01:00 committed by GitHub
commit bbf6fea1e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -860,7 +860,11 @@ static void task_load_handler(retro_task_t *task)
{ {
if (state->autoload) if (state->autoload)
{ {
#ifdef __CELLOS_LV2__
char *msg = (char*)malloc(8192 * sizeof(char));
#else
char msg[8192]; char msg[8192];
#endif
msg[0] = '\0'; msg[0] = '\0';
@ -871,6 +875,9 @@ static void task_load_handler(retro_task_t *task)
state->path, state->path,
msg_hash_to_str(MSG_FAILED)); msg_hash_to_str(MSG_FAILED));
task_set_error(task, strdup(msg)); task_set_error(task, strdup(msg));
#ifdef __CELLOS_LV2__
free(msg);
#endif
} }
else else
task_set_error(task, strdup(msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE))); task_set_error(task, strdup(msg_hash_to_str(MSG_FAILED_TO_LOAD_STATE)));