Skip to content

Commit

Permalink
Fix crash with Linux HTTP tasks - null pointer dereference
Browse files Browse the repository at this point in the history
inactive123 committed Jan 2, 2018
1 parent 3392984 commit 3528923
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gfx/video_display_server.c
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 2 additions & 0 deletions tasks/task_http.c
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 3528923

Please sign in to comment.