added assertion
authorBrian <brian@i915.localnet.net>
Wed, 8 Aug 2007 22:07:28 +0000 (16:07 -0600)
committerBrian <brian@i915.localnet.net>
Wed, 8 Aug 2007 22:10:40 +0000 (16:10 -0600)
src/mesa/pipe/softpipe/sp_surface.c

index 85e1fcfa38f66a2b0690d0bce8a93f7fe28b592c..174dcc016921a6f7d09778e52f1e7fa2e64b6155 100644 (file)
@@ -323,6 +323,8 @@ a8r8g8b8_get_tile(struct pipe_surface *ps,
    const GLuint *src
       = ((const GLuint *) ps->region->map) + y * ps->region->pitch + x;
    GLuint i, j;
+   assert(x + w <= ps->width);
+   assert(y + h <= ps->height);
    for (i = 0; i < h; i++) {
       for (j = 0; j < w; j++) {
          p[0] = UBYTE_TO_FLOAT((src[j] >> 16) & 0xff);