Permalink
Browse files

Return 0 for out-of-range inputs in ImageMitchellFilt::val

  • Loading branch information...
1 parent 3967fec commit 8a4f676d9e68336b1898af2c30456c5c0a79516c @snogglethorpe committed Apr 30, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 image-mitchell-filt.h
View
@@ -53,7 +53,9 @@ class ImageMitchellFilt : public ImageFilter
// This formula is from the PBRT book
//
- if (x > 1.f)
+ if (x > 2.f)
+ return 0;
+ else if (x > 1.f)
return ((-b - 6*c) * x*x*x + (6*b + 30*c) * x*x +
(-12*b - 48*c) * x + (8*b + 24*c)) * (1.f/6.f);
else

0 comments on commit 8a4f676

Please sign in to comment.