projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62f2d6e
)
swrast: replace assertion with conditional in _swrast_map_teximage()
author
Brian Paul
<brianp@vmware.com>
Mon, 26 Dec 2011 21:49:57 +0000
(14:49 -0700)
committer
Brian Paul
<brianp@vmware.com>
Mon, 26 Dec 2011 22:22:26 +0000
(15:22 -0700)
Just in case we ran out of memory when trying to allocate the texture
memory.
src/mesa/swrast/s_texture.c
patch
|
blob
|
history
diff --git
a/src/mesa/swrast/s_texture.c
b/src/mesa/swrast/s_texture.c
index 76a31eeae73cd79a3fcb2e4b1259a74bcc6bd9b9..e31cd62679b00c1474e60dd1df20422fda015a08 100644
(file)
--- a/
src/mesa/swrast/s_texture.c
+++ b/
src/mesa/swrast/s_texture.c
@@
-189,8
+189,12
@@
_swrast_map_teximage(struct gl_context *ctx,
stride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width);
_mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
- assert(swImage->Buffer);
-
+ if (!swImage->Buffer) {
+ /* probably ran out of memory when allocating tex mem */
+ *mapOut = NULL;
+ return;
+ }
+
map = swImage->Buffer;
if (texImage->TexObject->Target == GL_TEXTURE_3D ||