diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 18979d8df..631f2baa3 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -495,6 +495,7 @@ struct div: public boost::static_visitor template value_type operator() (T lhs, T rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } @@ -513,11 +514,13 @@ struct div: public boost::static_visitor value_type operator() (value_double lhs, value_integer rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } value_type operator() (value_integer lhs, value_double rhs) const { + if (rhs == 0) return std::numeric_limits::infinity(); return lhs / rhs; } };