From a52ce9de7d3ba1b244edaadbe976a0c794b0cc62 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 19 Feb 2008 08:27:08 -0700 Subject: [PATCH] If parameter is a 'counter', raise GL_INVALID_VALUE if value is negative Fixes bug 10984. --- src/mesa/glapi/glX_proto_send.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 ) -- 2.30.2