glthread: fall back if a param size is non-zero and a pointer param is NULL
authorMarek Olšák <marek.olsak@amd.com>
Tue, 25 Feb 2020 01:52:06 +0000 (20:52 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 01:06:14 +0000 (01:06 +0000)
So that we don't crash. This is a GL error anyway.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>

src/mapi/glapi/gen/gl_marshal.py

index 3147b702c702e9721c8201c598a55ad30efbea5e..05c4e28eec178e18c6d2d1ba4e7a34b77984bade 100644 (file)
@@ -225,6 +225,7 @@ class PrintCode(gl_XML.gl_print_base):
         for p in func.parameters:
             if p.is_variable_length():
                 list.append('{0}_size < 0'.format(p.name))
+                list.append('({0}_size > 0 && !{0})'.format(p.name))
 
         if len(list) == 0:
             return