From: havoc Date: Wed, 7 Jun 2006 06:19:54 +0000 (+0000) Subject: prevent Image_MipReduce from getting stuck in an infinite loop on 3D textures X-Git-Tag: xonotic-v0.1.0preview~3948 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6e38933ae76d551154e45b5dd171f6053a73fcf6;p=xonotic%2Fdarkplaces.git prevent Image_MipReduce from getting stuck in an infinite loop on 3D textures git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6428 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/image.c b/image.c index 4527c922..3899e1e2 100644 --- 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;