Port Mesa to build on a P64 platform (e.g., Win64). P64 platforms
use 64-bit pointers and 32-bit longs. So, operations like casting pointers to unsigned long and back to pointer won't work. glheader.h now includes files to define uintptr_t, which should instead be used for this sort of operation. It is an integer type that is the same size as a pointer.
This commit is contained in:
@@ -449,11 +449,11 @@ _mesa_validate_pbo_access(GLuint dimensions,
|
||||
format, type, depth-1, height-1, width);
|
||||
|
||||
|
||||
if ((const GLubyte *) start > (const GLubyte *) pack->BufferObj->Size) {
|
||||
if ((const GLubyte *) start > (const GLubyte *)(uintptr_t) pack->BufferObj->Size) {
|
||||
/* This will catch negative values / wrap-around */
|
||||
return GL_FALSE;
|
||||
}
|
||||
if ((const GLubyte *) end > (const GLubyte *) pack->BufferObj->Size) {
|
||||
if ((const GLubyte *) end > (const GLubyte *)(uintptr_t) pack->BufferObj->Size) {
|
||||
/* Image read goes beyond end of buffer */
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user