s/MAX_TEXTURE_LEVELS/SIS_MAX_TEXTURE_LEVELS/ and add assertion (bug 11806)
authorBrian <brian.paul@tungstengraphics.com>
Thu, 2 Aug 2007 14:35:13 +0000 (08:35 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 2 Aug 2007 14:35:13 +0000 (08:35 -0600)
src/mesa/drivers/dri/sis/sis_tex.c

index be87f16e2983cd21201ad2174148b7ccdabe6414..8fd7b26ba5593df2063781fed922b6b13b968f5a 100644 (file)
@@ -130,6 +130,8 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level,
 static void
 sisFreeTexImage( sisContextPtr smesa, sisTexObjPtr t, int level )
 {
+   assert(level >= 0);
+   assert(level < SIS_MAX_TEXTURE_LEVELS);
    if (t->image[level].Data == NULL)
       return;
 
@@ -213,7 +215,7 @@ sisDeleteTexture( GLcontext * ctx, struct gl_texture_object *texObj )
        */
       return;
    }
-   for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
+   for (i = 0; i < SIS_MAX_TEXTURE_LEVELS; i++) {
       sisFreeTexImage( smesa, t, i );
    }