mesa: Fix a NULL deref in glDeleteFragmentShaderATI(badname);
Fixes piglit ati-fs-bad-delete. Caught by clang.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user