Fixed NULL pointer dereferencing in linked lists

This commit is contained in:
GoaLitiuM
2014-09-27 01:35:36 +03:00
parent d17565afc8
commit 10f5d7f3aa
4 changed files with 8 additions and 4 deletions

View File

@@ -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");