]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
prevent Image_MipReduce from getting stuck in an infinite loop on 3D textures
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Jun 2006 06:19:54 +0000 (06:19 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Jun 2006 06:19:54 +0000 (06:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6428 d7cf8633-e32d-0410-b094-e92efae38249

image.c

diff --git a/image.c b/image.c
index 4527c922f7e58bd15b80b879232e85c94f746132..3899e1e234b447ece782a68667b54ce76b00e5ae 100644 (file)
--- a/image.c
+++ b/image.c
@@ -1357,6 +1357,12 @@ void Image_MipReduce(const unsigned char *in, unsigned char *out, int *width, in
        if (*depth != 1 || destdepth != 1)
        {
                Con_Printf ("Image_Resample: 3D resampling not supported\n");
+               if (*width > destwidth)
+                       width >>= 1;
+               if (*height > destheight)
+                       height >>= 1;
+               if (*depth > destdepth)
+                       depth >>= 1;
                return;
        }
        nextrow = *width * bytesperpixel;