]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 fc027b2f7138fa34d416cecef4499abf0272d6d1..0f08b5f9ea3df9047df57644a6861c286cb30425 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;