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-Tag: 062012170305~19015 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a52ce9de7d3ba1b244edaadbe976a0c794b0cc62;p=profile%2Fivi%2Fmesa.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 0fa0f7e..6207b00 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 )