From: Michel Dänzer Date: Thu, 4 Mar 2010 23:15:40 +0000 (+0100) Subject: Fix comparison of unsigned value against < 0. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=391b396f3fb300a912e6d9bfbf26f49cc30e52df;p=mesa.git Fix comparison of unsigned value against < 0. --- diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 326ad6f909b..e9359dbe5f6 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -147,7 +147,7 @@ check_index_bounds(GLcontext *ctx, GLsizei count, GLenum type, vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if (min + basevertex < 0 || + if ((int)(min + basevertex) < 0 || max + basevertex > ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is "