From 3de8fff45d04fd7e702cd656ba97cafd348c3981 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Dec 2009 08:30:01 -0700 Subject: [PATCH] mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS. See bug 25528. --- src/mesa/main/texobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2