swrast: assert _swrast_map_teximage() x, y is multiple of block size
authorBrian Paul <brianp@vmware.com>
Mon, 26 Dec 2011 21:49:57 +0000 (14:49 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 26 Dec 2011 22:22:26 +0000 (15:22 -0700)
src/mesa/swrast/s_texture.c

index e31cd62679b00c1474e60dd1df20422fda015a08..ffd78a2b895e7e7ffb425f0c27aaae8408f1dadd 100644 (file)
@@ -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;