diff options
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r-- | src/mesa/swrast/s_texture.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 76a31eeae73..e31cd62679b 100644 --- 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 || |