From: Brian Date: Tue, 19 Feb 2008 15:27:08 +0000 (-0700) Subject: If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a52ce9de7d3ba1b244edaadbe976a0c794b0cc62;p=mesa.git If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative Fixes bug 10984. --- 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 )