fix a crash with non-power-of-two particle textures
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Feb 2011 17:55:03 +0000 (17:55 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 26 Feb 2011 17:55:03 +0000 (17:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10866 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c

index fc027b2..0f08b5f 100644 (file)
@@ -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;