From 1b7f6a97f5e3649cf34f5dc1806ca1a6ed8e3b99 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 20 Mar 2015 06:43:08 +0000 Subject: [PATCH] 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 ::stable-branch::merge=77a6e7054168e0e4eb2eeda3fe320f9c2940ecab --- gl_rmain.c | 2 +- model_brush.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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) -- 2.39.2