From d0f0f9690f154b24c869dcf7a95ed132ff707d46 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 8 Nov 2012 16:39:31 -0500 Subject: [PATCH] zero color images are not valid - catch this earlier on - closes #1568 --- src/image_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image_util.cpp b/src/image_util.cpp index b30e1674f..2cf22d186 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -149,7 +149,7 @@ void handle_png_options(std::string const& type, if (*colors < 0) throw ImageWriterException("invalid color parameter: unavailable for true color images"); - if (!mapnik::util::string2int(t.substr(2),*colors) || *colors < 0 || *colors > 256) + if (!mapnik::util::string2int(t.substr(2),*colors) || *colors < 1 || *colors > 256) throw ImageWriterException("invalid color parameter: " + t.substr(2)); } else if (boost::algorithm::starts_with(t, "t="))