Mesa (master): mesa: Fix pointer arithmetic.

Michał Król michal at kemper.freedesktop.org
Tue Nov 24 11:03:24 UTC 2009


Module: Mesa
Branch: master
Commit: 53d9b7d361915d6cf33b73017789e746342cc453
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53d9b7d361915d6cf33b73017789e746342cc453

Author: Michal Krol <michal at vmware.com>
Date:   Tue Nov 24 11:17:16 2009 +0100

mesa: Fix pointer arithmetic.

---

 src/mesa/main/texgetimage.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 0084072..bd7cc8d 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -554,7 +554,9 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
       GLuint bw, bh;
       _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh);
       for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) {
-         memcpy(img + i * row_stride, texImage->Data + i * row_stride_stored, row_stride);
+         memcpy((GLubyte *)img + i * row_stride,
+                (GLubyte *)texImage->Data + i * row_stride_stored,
+                row_stride);
       }
    }
 




More information about the mesa-commit mailing list