From: havoc Date: Sat, 26 Feb 2011 17:55:03 +0000 (+0000) Subject: fix a crash with non-power-of-two particle textures X-Git-Tag: xonotic-v0.5.0~425^2~37 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=0af6863552b327a7799982ffbb44035bbd22228f fix a crash with non-power-of-two particle textures git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10866 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_textures.c b/gl_textures.c index fc027b2f..0f08b5f9 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -1156,7 +1156,7 @@ static void R_UploadFullTexture(gltexture_t *glt, const unsigned char *data) { // multiply RGB channels by A channel before uploading int alpha; - for (i = 0;i < width*height*depth*4;i += 4) + for (i = 0;i < glt->inputwidth*glt->inputheight*glt->inputdepth*4;i += 4) { alpha = prevbuffer[i+3]; colorconvertbuffer[i] = (prevbuffer[i] * alpha) >> 8;