]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
workaround for bounds checking error in loading texture lump
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Jan 2001 16:38:16 +0000 (16:38 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Jan 2001 16:38:16 +0000 (16:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@124 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index d5c8c3e386a1ddcd58e2572010025a0c803db5c5..d86b498e54e333940007fc42b9ac791e529acfb0 100644 (file)
@@ -111,6 +111,7 @@ void Mod_LoadTextures (lump_t *l)
        texture_t       *altanims[10];
        dmiptexlump_t *m;
        byte    *data;
+       int             *dofs;
 
        if (!l->filelen)
        {
@@ -125,12 +126,14 @@ void Mod_LoadTextures (lump_t *l)
        loadmodel->numtextures = m->nummiptex;
        loadmodel->textures = Hunk_AllocName (m->nummiptex * sizeof(*loadmodel->textures) , loadname);
 
+       // just to work around bounds checking when debugging with it (array index out of bounds error thing)
+       dofs = m->dataofs;
        for (i=0 ; i<m->nummiptex ; i++)
        {
-               m->dataofs[i] = LittleLong(m->dataofs[i]);
-               if (m->dataofs[i] == -1)
+               dofs[i] = LittleLong(dofs[i]);
+               if (dofs[i] == -1)
                        continue;
-               mt = (miptex_t *)((byte *)m + m->dataofs[i]);
+               mt = (miptex_t *)((byte *)m + dofs[i]);
                mt->width = LittleLong (mt->width);
                mt->height = LittleLong (mt->height);
                for (j=0 ; j<MIPLEVELS ; j++)