From 014930183e85a5b2f82de77422f36272a0f9a48d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 9 May 2000 08:21:44 +0000 Subject: [PATCH] fix an fp fault with 1x1 textures when gl_picmap > 0 --- common/gl_draw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/gl_draw.c b/common/gl_draw.c index c7512dc..f6260b7 100644 --- a/common/gl_draw.c +++ b/common/gl_draw.c @@ -1176,10 +1176,8 @@ static unsigned scaled[1024*512]; // [512*256]; scaled_width >>= (int)gl_picmip->value; scaled_height >>= (int)gl_picmip->value; - if (scaled_width > gl_max_size->value) - scaled_width = gl_max_size->value; - if (scaled_height > gl_max_size->value) - scaled_height = gl_max_size->value; + scaled_width = max (1, min (scaled_width, gl_max_size->value)); + scaled_height = max (1, min (scaled_height, gl_max_size->value)); if (scaled_width * scaled_height > sizeof(scaled)/4) Sys_Error ("GL_LoadTexture: too big");