Fix crash with Linux HTTP tasks - null pointer dereference

This commit is contained in:
twinaphex 2018-01-02 13:41:59 +01:00
parent 33929842bb
commit 3528923507
2 changed files with 10 additions and 3 deletions

View File

@ -46,7 +46,8 @@ void* video_display_server_init(void)
current_display_server_data = current_display_server->init();
RARCH_LOG("[Video]: Found display server: %s\n", current_display_server->ident);
RARCH_LOG("[Video]: Found display server: %s\n",
current_display_server->ident);
return current_display_server_data;
}
@ -58,10 +59,14 @@ void video_display_server_destroy(void)
bool video_display_server_set_window_opacity(unsigned opacity)
{
return current_display_server->set_window_opacity(current_display_server_data, opacity);
if (current_display_server && current_display_server->set_window_opacity)
return current_display_server->set_window_opacity(current_display_server_data, opacity);
return false;
}
bool video_display_server_set_window_progress(int progress, bool finished)
{
return current_display_server->set_window_progress(current_display_server_data, progress, finished);
if (current_display_server && current_display_server->set_window_progress)
return current_display_server->set_window_progress(current_display_server_data, progress, finished);
return false;
}

View File

@ -237,6 +237,8 @@ static bool task_http_retriever(retro_task_t *task, void *data)
static void http_transfer_progress_cb(retro_task_t *task)
{
if (!task)
return;
video_display_server_set_window_progress(task->progress, task->finished);
}