projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbeceec
)
mesa: Fix a NULL deref in glDeleteFragmentShaderATI(badname);
author
Eric Anholt
<eric@anholt.net>
Tue, 22 Dec 2009 20:38:11 +0000
(12:38 -0800)
committer
Eric Anholt
<eric@anholt.net>
Tue, 22 Dec 2009 22:20:26 +0000
(14:20 -0800)
Fixes piglit ati-fs-bad-delete. Caught by clang.
src/mesa/shader/atifragshader.c
patch
|
blob
|
history
diff --git
a/src/mesa/shader/atifragshader.c
b/src/mesa/shader/atifragshader.c
index ac087d415c5df2f829c5bf80bd8d8e946b978fa0..e04a05b22fff0ca5ccf7c6d2300293f11b52f3b0 100644
(file)
--- 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);
+ }
}
}
}