From eb4c294a3e0e25113c978fd6ea5951dd48fc1c8b Mon Sep 17 00:00:00 2001 From: Jon Sneyers Date: Sat, 10 Sep 2016 17:43:05 +0200 Subject: [PATCH] bugfix: if data actually needed padding for alignment, there was a big problem ;) --- src/image/image.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/image/image.hpp b/src/image/image.hpp index 5a784da1..39a823a1 100644 --- a/src/image/image.hpp +++ b/src/image/image.hpp @@ -321,11 +321,11 @@ template class Plane final : public GeneralPlane { #endif void set(const int z, const uint32_t r, const uint32_t c, const ColorVal x) override { // set(r*zoom_rowpixelsize(z),c*zoom_colpixelsize(z),x); - data_vec[(r*zoom_rowpixelsize(z)>>s)*width + (c*zoom_colpixelsize(z)>>s)] = x; + data[(r*zoom_rowpixelsize(z)>>s)*width + (c*zoom_colpixelsize(z)>>s)] = x; } ColorVal get(const int z, const uint32_t r, const uint32_t c) const override { // return get(r*zoom_rowpixelsize(z),c*zoom_colpixelsize(z)); - return data_vec[(r*zoom_rowpixelsize(z)>>s)*width + (c*zoom_colpixelsize(z)>>s)]; + return data[(r*zoom_rowpixelsize(z)>>s)*width + (c*zoom_colpixelsize(z)>>s)]; } void normalize_scale() override { s = 0; } @@ -341,7 +341,7 @@ template class Plane final : public GeneralPlane { for (pixel_t& x : data) x = swap(x); } #endif - uint32_t result = crc32_fast(&data_vec[0], width*height*sizeof(pixel_t), previous_crc32); + uint32_t result = crc32_fast(&data[0], width*height*sizeof(pixel_t), previous_crc32); #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ // make the buffer big endian again if (sizeof(pixel_t) == 2) {