From: Brian Paul Date: Mon, 8 Feb 2016 22:30:39 +0000 (-0700) Subject: mesa: add missing error check in _mesa_CallLists() X-Git-Tag: upstream/17.1.0~12736 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=711d5347cf4e4cae60461487bcf416c915aa7395;p=platform%2Fupstream%2Fmesa.git 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 --- diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index cd8e3b6..65f0929 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. */