summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-02-08 15:30:39 -0700
committerBrian Paul <[email protected]>2016-02-09 11:27:48 -0700
commit711d5347cf4e4cae60461487bcf416c915aa7395 (patch)
treebc0d9d52fe85bcbf99c59ab03d0204b10c7195ad
parentb1ddc03633c3bff7e81964ef0c4419cf66d40e02 (diff)
mesa: add missing error check in _mesa_CallLists()
Generate GL_INVALID_VALUE if n < 0. Return early if n==0 or lists==NULL. v2: fix formatting, also check for lists==NULL. Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r--src/mesa/main/dlist.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index cd8e3b6a2f2..65f092936b3 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -9105,6 +9105,14 @@ _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 || lists == NULL) {
+ /* nothing to do */
+ return;
+ }
+
/* Save the CompileFlag status, turn it off, execute display list,
* and restore the CompileFlag.
*/