From 12f051bf5638aa75736af4c1d1994fd35c015196 Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 9 Dec 2014 11:47:47 +0100 Subject: [PATCH] image_data - fix setRow implementation --- include/mapnik/image_data.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mapnik/image_data.hpp b/include/mapnik/image_data.hpp index d2bdc02b8..1b6a09e90 100644 --- a/include/mapnik/image_data.hpp +++ b/include/mapnik/image_data.hpp @@ -188,7 +188,9 @@ public: } inline void setRow(std::size_t row, std::size_t x0, std::size_t x1, pixel_type const* buf) { - std::copy(buf, buf + (x1 - x0), pData_ + row * width_); + assert(row < height_); + assert ((x1 - x0) <= width_ ); + std::copy(buf, buf + (x1 - x0), pData_ + row * width_ + x0); } private: std::size_t width_;