From ac50139c54419504894ccf1d38b64d2cb3764685 Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Fri, 23 Mar 2018 11:55:06 +0000 Subject: [PATCH] Raster colorizer: check image bounds --- src/raster_colorizer.cpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index b30221e27..237dd9329 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -129,20 +129,25 @@ void raster_colorizer::colorize(image_rgba8 & out, T const& in, { using image_type = T; using pixel_type = typename image_type::pixel_type; - // TODO: assuming in/out have the same width/height for now - std::uint32_t * out_data = out.data(); - pixel_type const* in_data = in.data(); - int len = out.width() * out.height(); - for (int i=0; i