summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-19 08:27:08 -0700
committerBrian <[email protected]>2008-02-19 08:29:16 -0700
commita52ce9de7d3ba1b244edaadbe976a0c794b0cc62 (patch)
tree4192160dde6b0581e56f38bd8d4dfec2a30c2cd3 /src/mesa/glapi
parent9993ccce690e5811a48f9b1a5e2155db446187b0 (diff)
If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative
Fixes bug 10984.
Diffstat (limited to 'src/mesa/glapi')
-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 0fa0f7e8706..6207b00a943 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 )