From: Brian Paul Date: Wed, 9 Dec 2009 15:30:01 +0000 (-0700) Subject: mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3de8fff45d04fd7e702cd656ba97cafd348c3981;p=mesa.git mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS. See bug 25528. --- diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index da55ac8697d..85f5f78e509 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -418,7 +418,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Detect cases where the application set the base level to an invalid * value. */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s);