summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/atifragshader.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/shader/atifragshader.c')
-rw-r--r--src/mesa/shader/atifragshader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c
index ac087d415c5..e04a05b22ff 100644
--- a/src/mesa/shader/atifragshader.c
+++ b/src/mesa/shader/atifragshader.c
@@ -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);
+ }
}
}
}