From 2783bcaa239caab7bcd980a1c30e7302a8d6123c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 22 May 2012 14:12:30 +1000 Subject: [PATCH] Check weight is within bounds for quintic lerp --- lerp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lerp.cpp b/lerp.cpp index 3dd57b3d..f930e5b8 100644 --- a/lerp.cpp +++ b/lerp.cpp @@ -61,6 +61,7 @@ lerp::cubic (double a, double b, double weight) { double lerp::quintic (double a, double b, double weight) { + CHECK (weight >= 0.0 && weight <= 1.0); double t = weight * weight * weight * (weight * (weight * 6.0 - 15.0) + 10.0); return a * (1.0 - t) + b * t; }