Browse Source

mesa: Fix a NULL deref in glDeleteFragmentShaderATI(badname);

Fixes piglit ati-fs-bad-delete.  Caught by clang.
tags/7.8-rc1
Eric Anholt 16 years ago
parent
commit
b08ed4f595
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/mesa/shader/atifragshader.c

+ 5
- 3
src/mesa/shader/atifragshader.c View File

@@ -290,9 +290,11 @@ _mesa_DeleteFragmentShaderATI(GLuint id)

/* The ID is immediately available for re-use now */
_mesa_HashRemove(ctx->Shared->ATIShaders, id);
prog->RefCount--;
if (prog->RefCount <= 0) {
_mesa_free(prog);
if (prog) {
prog->RefCount--;
if (prog->RefCount <= 0) {
_mesa_free(prog);
}
}
}
}

Loading…
Cancel
Save