Signed-off-by: Yuanhan Liu <[email protected]>
---
src/mesa/main/pbo.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/mesa/main/pbo.c b/src/mesa/main/pbo.c
index 4e7e6f9..4611c5d 100644
--- a/src/mesa/main/pbo.c
+++ b/src/mesa/main/pbo.c
@@ -82,6 +82,11 @@ _mesa_validate_pbo_access(GLuint dimensions,
} else {
offset = ptr;
sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size;
+ if (_mesa_sizeof_type(type) &&
+ ((GLuint)offset % _mesa_sizeof_type(type))) {
+ /* offset not aligned with type size */
+ return GL_FALSE;
+ }
}
if (sizeAddr == 0)
--
1.7.4.4
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev