From: Brian Paul Date: Mon, 26 Dec 2011 21:49:57 +0000 (-0700) Subject: swrast: assert _swrast_map_teximage() x, y is multiple of block size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98dffd9764195be2734579a2b4ae7637b62ea7d8;p=mesa.git swrast: assert _swrast_map_teximage() x, y is multiple of block size --- diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index e31cd62679b..ffd78a2b895 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -189,6 +189,9 @@ _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(x % bw == 0); + assert(y % bh == 0); + if (!swImage->Buffer) { /* probably ran out of memory when allocating tex mem */ *mapOut = NULL;