Mesa (mesa_7_6_branch): mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test

Brian Paul brianp at kemper.freedesktop.org
Wed Dec 9 07:31:04 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 3de8fff45d04fd7e702cd656ba97cafd348c3981
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3de8fff45d04fd7e702cd656ba97cafd348c3981

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Dec  9 08:30:01 2009 -0700

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index da55ac8..85f5f78 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);



More information about the mesa-commit mailing list