Return 0 as the request size when the pixels parameter is NULL
authorNeil Roberts <neil@linux.intel.com>
Tue, 2 Dec 2008 15:03:01 +0000 (15:03 +0000)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 15 Dec 2008 02:46:17 +0000 (18:46 -0800)
img_null_flag was being ignored when calculating the size of a request
so a BadLength error gets thrown for glTexImage3D when the pixels
parameter is NULL.

See bug #11003

src/mesa/glapi/glX_proto_size.py

index 2b9a643362282c30e57c4d8f34b17f4d93a66aca..95cb5110cc3cc8d7dd08619883a90ddd33d15432 100644 (file)
@@ -581,6 +581,11 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common):
 
                self.common_emit_fixups(fixup)
 
+               if img.img_null_flag:
+                       print ''
+                       print '    if (*(CARD32 *) (pc + %s))' % (img.offset - 4)
+                       print '        return 0;'
+
                print ''
                print '    return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d )
                print '                          image_height, row_length, skip_images,'