Fixed NULL pointer dereferencing in linked lists
This commit is contained in:
parent
d17565afc8
commit
10f5d7f3aa
@ -673,7 +673,8 @@ void gs_program_destroy(struct gs_program *program)
|
||||
|
||||
if (program->next)
|
||||
program->next->prev_next = program->prev_next;
|
||||
*program->prev_next = program->next;
|
||||
if (program->prev_next)
|
||||
*program->prev_next = program->next;
|
||||
|
||||
glDeleteProgram(program->obj);
|
||||
gl_success("glDeleteProgram");
|
||||
|
@ -99,7 +99,8 @@ static inline void audio_output_removeline(struct audio_output *audio,
|
||||
struct audio_line *line)
|
||||
{
|
||||
pthread_mutex_lock(&audio->line_mutex);
|
||||
*line->prev_next = line->next;
|
||||
if (line->prev_next)
|
||||
*line->prev_next = line->next;
|
||||
if (line->next)
|
||||
line->next->prev_next = line->prev_next;
|
||||
pthread_mutex_unlock(&audio->line_mutex);
|
||||
|
@ -86,7 +86,8 @@ void obs_display_destroy(obs_display_t *display)
|
||||
{
|
||||
if (display) {
|
||||
pthread_mutex_lock(&obs->data.displays_mutex);
|
||||
*display->prev_next = display->next;
|
||||
if (display->prev_next)
|
||||
*display->prev_next = display->next;
|
||||
if (display->next)
|
||||
display->next->prev_next = display->prev_next;
|
||||
pthread_mutex_unlock(&obs->data.displays_mutex);
|
||||
|
@ -1326,7 +1326,8 @@ void obs_context_data_remove(struct obs_context_data *context)
|
||||
{
|
||||
if (context && context->mutex) {
|
||||
pthread_mutex_lock(context->mutex);
|
||||
*context->prev_next = context->next;
|
||||
if (context->prev_next)
|
||||
*context->prev_next = context->next;
|
||||
if (context->next)
|
||||
context->next->prev_next = context->prev_next;
|
||||
pthread_mutex_unlock(context->mutex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user