Fix a crash when playing q2bsp maps where t->currentframe is dereferenced, and it...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 20 Mar 2015 06:43:08 +0000 (06:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 20 Mar 2015 06:43:08 +0000 (06:43 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12207 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c
model_brush.c

index 50fca59..9fe3087 100644 (file)
@@ -8431,7 +8431,7 @@ texture_t *R_GetCurrentTexture(texture_t *t)
                }
        }
 
-       return t->currentframe;
+       return t;
 }
 
 rsurfacestate_t rsurface;
index 6fd45ee..66cb6d0 100644 (file)
@@ -4417,6 +4417,7 @@ static void Mod_Q2BSP_LoadTexinfo(sizebuf_t *sb)
        {
                int j;
                texture_t *t = loadmodel->data_textures + out->textureindex;
+               t->currentframe = t; // fix the reallocated pointer
 
                // if this is not animated, skip it
                // if this is already processed, skip it (part of an existing sequence)