llvmpipe: Fix null pointer dereference when no depth buffer is bound.

This commit is contained in:
José Fonseca 2010-02-10 11:25:26 +00:00
parent 5e6a900510
commit ba33fed610
1 changed files with 3 additions and 0 deletions

View File

@ -139,6 +139,9 @@ lp_rast_depth_pointer( struct lp_rasterizer *rast,
void * depth;
assert((x % TILE_VECTOR_WIDTH) == 0);
assert((y % TILE_VECTOR_HEIGHT) == 0);
if(!rast->zsbuf_map)
return NULL;
assert(rast->zsbuf_transfer);
depth = rast->zsbuf_map +
y*rast->zsbuf_transfer->stride +
TILE_VECTOR_HEIGHT*x*util_format_get_blocksize(rast->zsbuf_transfer->texture->format);