summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-04-25 22:34:37 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-04-28 16:31:45 -0700
commit2655265fcba9017e793026c76e490e04db088c8f (patch)
tree44a3b61748fdc616e571efefea31e3bb0bbf5785 /src/mesa/main/api_validate.c
parent70f89dd75ee7487d0143fa871bb20cbd29f54da0 (diff)
downloadexternal_mesa3d-2655265fcba9017e793026c76e490e04db088c8f.zip
external_mesa3d-2655265fcba9017e793026c76e490e04db088c8f.tar.gz
external_mesa3d-2655265fcba9017e793026c76e490e04db088c8f.tar.bz2
mesa: Fix indirect draw buffer size check on 32-bit systems.
Fixes dEQP-GLES31.functional subtests: draw_indirect.negative.command_offset_not_in_buffer_signed32_wrap draw_indirect.negative.command_offset_not_in_buffer_unsigned32_wrap These tests use really large values that overflow GLsizeiptr, at which point the buffer size isn't less than "end". Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95138 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 2b62997..688408f 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -696,7 +696,7 @@ valid_draw_indirect(struct gl_context *ctx,
GLenum mode, const GLvoid *indirect,
GLsizei size, const char *name)
{
- const GLsizeiptr end = (GLsizeiptr)indirect + size;
+ const uint64_t end = (uint64_t) (uintptr_t) indirect + size;
/* OpenGL ES 3.1 spec. section 10.5:
*