swrast: replace assertion with conditional in _swrast_map_teximage()

Just in case we ran out of memory when trying to allocate the texture
memory.
This commit is contained in:
Brian Paul
2011-12-26 14:49:57 -07:00
parent 62f2d6ef03
commit 08a81c8697
+6 -2
View File
@@ -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 ||