From: havoc Date: Fri, 20 Mar 2015 06:43:08 +0000 (+0000) Subject: Fix a crash when playing q2bsp maps where t->currentframe is dereferenced, and it... X-Git-Tag: xonotic-v0.8.5~88^2~114 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=77a6e7054168e0e4eb2eeda3fe320f9c2940ecab;p=xonotic%2Fdarkplaces.git Fix a crash when playing q2bsp maps where t->currentframe is dereferenced, and it is a dangling pointer that was left corrupt by the loader - fixed that as well. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12207 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 50fca599..9fe3087c 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -8431,7 +8431,7 @@ texture_t *R_GetCurrentTexture(texture_t *t) } } - return t->currentframe; + return t; } rsurfacestate_t rsurface; diff --git a/model_brush.c b/model_brush.c index 6fd45ee7..66cb6d0b 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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)