summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-02-19 08:27:08 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-02-19 08:29:16 -0700
commita52ce9de7d3ba1b244edaadbe976a0c794b0cc62 (patch)
tree4192160dde6b0581e56f38bd8d4dfec2a30c2cd3 /src
parent9993ccce690e5811a48f9b1a5e2155db446187b0 (diff)
If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative
Fixes bug 10984.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/glapi/glX_proto_send.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/glapi/glX_proto_send.py b/src/mesa/glapi/glX_proto_send.py
index 0fa0f7e870..6207b00a94 100644
--- a/src/mesa/glapi/glX_proto_send.py
+++ b/src/mesa/glapi/glX_proto_send.py
@@ -554,6 +554,14 @@ generic_%u_byte( GLint rop, const void * ptr )
condition_list = []
for p in f.parameterIterateCounters():
condition_list.append( "%s >= 0" % (p.name) )
+ # 'counter' parameters cannot be negative
+ print " if (%s < 0) {" % p.name
+ print " __glXSetError(gc, GL_INVALID_VALUE);"
+ if f.return_type != 'void':
+ print " return 0;"
+ else:
+ print " return;"
+ print " }"
if skip_condition:
condition_list.append( skip_condition )