From cdc63767192a101903a24420605dee3d29f6b280 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 16 Mar 2012 14:49:56 -0700 Subject: [PATCH] be explicit about zero-division protection --- include/mapnik/ctrans.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mapnik/ctrans.hpp b/include/mapnik/ctrans.hpp index 014073906..31c62f391 100644 --- a/include/mapnik/ctrans.hpp +++ b/include/mapnik/ctrans.hpp @@ -397,9 +397,9 @@ public: sx_(1.0), sy_(1.0) { - if (extent_.width()) + if (extent_.width() > 0) sx_ = static_cast(width_) / extent_.width(); - if (extent_.height()) + if (extent_.height() > 0) sy_ = static_cast(height_) / extent_.height(); }