Mesa (gallium-0.2): draw: Avoid integer overflow converting pointers on 64bit archs.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Dec 31 13:06:41 UTC 2008


Module: Mesa
Branch: gallium-0.2
Commit: 2f24bc698412b4635422a52f9d7073ce7854dceb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2f24bc698412b4635422a52f9d7073ce7854dceb

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Dec 30 20:10:24 2008 +0000

draw: Avoid integer overflow converting pointers on 64bit archs.

Not really an error, as we only care for the lower 4 bits.

---

 src/gallium/auxiliary/draw/draw_vs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 7f30530..c057cd6 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -50,7 +50,7 @@ void draw_vs_set_constants( struct draw_context *draw,
                             const float (*constants)[4],
                             unsigned size )
 {
-   if (((unsigned)constants) & 0xf) {
+   if (((uintptr_t)constants) & 0xf) {
       if (size > draw->vs.const_storage_size) {
          if (draw->vs.aligned_constant_storage)
             align_free((void *)draw->vs.aligned_constant_storage);




More information about the mesa-commit mailing list