From: divverent Date: Tue, 31 Jan 2012 08:49:09 +0000 (+0000) Subject: fix a compile error; don't reallocate if target is same size (not sure if that can... X-Git-Tag: xonotic-v0.8.0~96^2~349 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cec60073b4236f885b1b88c4c5defd3475085069;p=xonotic%2Fdarkplaces.git fix a compile error; don't reallocate if target is same size (not sure if that can ever happen though) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11664 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_textures.c b/gl_textures.c index 8dc1cae6..742d8b70 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -2702,8 +2702,14 @@ rtexture_t *R_LoadTextureDDSFile(rtexturepool_t *rtexturepool, const char *filen { upload_mipwidth = (glt->tilewidth >> mip); upload_mipheight = (glt->tileheight >> mip); - upload_mippixels = Mem_Alloc(tempmempool, 4 * upload_mipwidth * upload_mipheight); - Image_Resample32(mippixels, mipwidth, mipheight, 1, upload_mippixels, upload_mipwidth, upload_mipheight, 1, r_lerpimages.integer); + if(upload_mipwidth != mipwidth || upload_mipheight != mipheight) + // I _think_ they always mismatch, but I was too lazy + // to properly check, and this test here is really + // harmless + { + upload_mippixels = (unsigned char *) Mem_Alloc(tempmempool, 4 * upload_mipwidth * upload_mipheight); + Image_Resample32(mippixels, mipwidth, mipheight, 1, upload_mippixels, upload_mipwidth, upload_mipheight, 1, r_lerpimages.integer); + } } switch(vid.renderpath) {