From 41a62ba96bd8caa718e8132b5ad2ebba7052ea65 Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 12 Jan 2015 01:54:33 +0000 Subject: [PATCH] Fix undefined behavior in Polymost git-svn-id: https://svn.eduke32.com/eduke32@4907 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 9a79eec7c..dfc69a224 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -610,8 +610,8 @@ static float get_projhack_ratio(void) else if (glprojectionhacks == 2) { float const abs_shang = Bfabsf(gshang); - if (abs_shang > 0.7f) - rv = 1.05f + 4.f * (abs_shang - 0.7f); + rv = (abs_shang > 0.7f) ? + 1.05f + 4.f * (abs_shang - 0.7f) : 1.f; } else rv = 1.f;