From 6e38933ae76d551154e45b5dd171f6053a73fcf6 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 7 Jun 2006 06:19:54 +0000 Subject: [PATCH] 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 --- image.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.2