diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index e5f0b5db6..f6918dccd 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -26,13 +26,17 @@ // mapnik #include #include +#include + // boost #include + // stl #include #include #include // for std::back_insert_iterator + namespace mapnik { namespace filter { struct blur {}; @@ -66,7 +70,15 @@ struct scale_hsla l0(_l0), l1(_l1), a0(_a0), - a1(_a1) {} + a1(_a1) { + if (h0 < 0 || h1 > 1 || + s0 < 0 || s1 > 1 || + l0 < 0 || l1 > 1 || + a0 < 0 || a1 > 1) + { + throw config_error("scale-hsla values must be between 0 and 1"); + } + } inline bool is_identity() const { return (h0 == 0 && h1 == 1 && diff --git a/tests/data/broken_maps/invalid-scale-hsla-filter.xml b/tests/data/broken_maps/invalid-scale-hsla-filter.xml new file mode 100644 index 000000000..fec9d9eb0 --- /dev/null +++ b/tests/data/broken_maps/invalid-scale-hsla-filter.xml @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml b/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml index 4d691fbaa..96a0756a3 100644 --- a/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml +++ b/tests/visual_tests/styles/marker-with-background-image-and-hsla-transform.xml @@ -1,7 +1,7 @@