projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3fe44c
)
st/mesa: add null pointer check in st_texture_image_map()
author
Brian Paul
<brianp@vmware.com>
Fri, 16 Mar 2012 15:31:13 +0000
(09:31 -0600)
committer
Brian Paul
<brianp@vmware.com>
Sat, 17 Mar 2012 22:15:59 +0000
(16:15 -0600)
If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it. Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.
Fixes a crash with the upcoming piglit max-texture-size test.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_texture.c
patch
|
blob
|
history
diff --git
a/src/mesa/state_tracker/st_texture.c
b/src/mesa/state_tracker/st_texture.c
index 132d7a81c63c67ea0ed4d4e0a8765366213f9e1d..9627a61177cf88289fa16a18d0fd5a519c5d91ec 100644
(file)
--- a/
src/mesa/state_tracker/st_texture.c
+++ b/
src/mesa/state_tracker/st_texture.c
@@
-222,6
+222,9
@@
st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
DBG("%s \n", __FUNCTION__);
+ if (!stImage->pt)
+ return NULL;
+
if (stObj->pt != stImage->pt)
level = 0;
else