From: Brian Paul Date: Thu, 21 Jan 2010 00:40:48 +0000 (-0700) Subject: softpipe: added region assertions in softpipe_get_tex_transfer() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=074abd889f7f5d2c7805a2c0fe118f463101a63d;p=mesa.git softpipe: added region assertions in softpipe_get_tex_transfer() --- diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index fae72c81aa1..45e80c54477 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -291,6 +291,10 @@ softpipe_get_tex_transfer(struct pipe_screen *screen, assert(texture); assert(level <= texture->last_level); + /* make sure the requested region is in the image bounds */ + assert(x + w <= u_minify(texture->width0, level)); + assert(y + h <= u_minify(texture->height0, level)); + spt = CALLOC_STRUCT(softpipe_transfer); if (spt) { struct pipe_transfer *pt = &spt->base;