fix addressing error in read_stencil_pixels()
authorBrian <brian.paul@tungstengraphics.com>
Wed, 17 Oct 2007 20:56:55 +0000 (14:56 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 17 Oct 2007 20:56:55 +0000 (14:56 -0600)
src/mesa/state_tracker/st_cb_readpixels.c

index 3fcce2463cd1499d2d2a158c5b0fb6cde23e48a3..8c9c47a53538495119dd92d0e4dd8c72cb8aeb24 100644 (file)
@@ -87,13 +87,13 @@ read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
       switch (ps->format) {
       case PIPE_FORMAT_U_S8:
          {
-            const ubyte *src = stmap + y * ps->region->pitch + x;
+            const ubyte *src = stmap + srcY * ps->region->pitch + x;
             memcpy(values, src, width);
          }
          break;
       case PIPE_FORMAT_S8_Z24:
          {
-            const uint *src = (const uint *) stmap + y * ps->region->pitch + x;
+            const uint *src = (uint *) stmap + srcY * ps->region->pitch + x;
             GLint k;
             for (k = 0; k < width; k++) {
                values[k] = src[k] >> 24;