[Mesa-dev] [PATCH] mesa: add missing error check in _mesa_CallLists()

Brian Paul brianp at vmware.com
Mon Feb 8 22:31:20 UTC 2016


Generate GL_INVALID_VALUE if n < 0.  Return early if n==0.
---
 src/mesa/main/dlist.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index cd8e3b6..24aea35 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -9105,6 +9105,15 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
       return;
    }
 
+   if (n < 0) {
+      _mesa_error(ctx, GL_INVALID_VALUE, "glCallLists(n < 0)");
+      return;
+   }
+   else if (n == 0) {
+      /* nothing to do */
+      return;
+   }
+
    /* Save the CompileFlag status, turn it off, execute display list,
     * and restore the CompileFlag.
     */
-- 
1.9.1



More information about the mesa-dev mailing list