mesa: Fix assertion failure when a cube face is not present.
authorEric Anholt <eric@anholt.net>
Mon, 14 May 2012 17:15:52 +0000 (10:15 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 17 May 2012 17:05:24 +0000 (10:05 -0700)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texobj.c

index 365169dddc6ad43825fbea9c1f1e9d4ff07f26b5..a471bad22b623dcca03d2b83c7ff8b39a70f5fc8 100644 (file)
@@ -558,7 +558,8 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
       GLuint face;
       assert(baseImage->Width2 == baseImage->Height);
       for (face = 1; face < 6; face++) {
-         assert(t->Image[face][baseLevel]->Width2 ==
+         assert(t->Image[face][baseLevel] == NULL ||
+                t->Image[face][baseLevel]->Width2 ==
                 t->Image[face][baseLevel]->Height2);
          if (t->Image[face][baseLevel] == NULL ||
              t->Image[face][baseLevel]->Width2 != baseImage->Width2) {