summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorartemp <artem@mapnik.org>2014-11-17 11:40:27 +0100
committerartemp <artem@mapnik.org>2014-11-17 11:40:27 +0100
commit9051ae17cf65339546b6328896f3d2854b16c861 (patch)
treefc6964565ba619b16a80fd4f1390b3854f199ba4 /platform
parentc8dea1024d6aa43749d5f8c0f2141a7010b5c3fb (diff)
downloadqtlocation-mapboxgl-9051ae17cf65339546b6328896f3d2854b16c861.tar.gz
fix png_reader
Diffstat (limited to 'platform')
-rw-r--r--platform/default/png_reader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/default/png_reader.cpp b/platform/default/png_reader.cpp
index 33d17a1b82..76437dec38 100644
--- a/platform/default/png_reader.cpp
+++ b/platform/default/png_reader.cpp
@@ -248,7 +248,7 @@ void png_reader<T>::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char
// alloc row pointers
const std::unique_ptr<png_bytep[]> rows(new png_bytep[height_]);
for (unsigned row = 0; row < height_; ++row)
- rows[row] = (png_bytep)image + row * width_ ;
+ rows[row] = (png_bytep)image + row * width_ * 4 ;
png_read_image(png_ptr, rows.get());
}
else
@@ -263,7 +263,7 @@ void png_reader<T>::read(unsigned x0, unsigned y0, unsigned w, unsigned h, char
png_read_row(png_ptr,row.get(),0);
if (i >= y0 && i < (y0 + h))
{
- std::copy(&row[x0 * 4], &row[x0 * 4] + w, image + i * width_* 4);
+ std::copy(&row[x0 * 4], &row[x0 * 4] + w * 4, image + i * width_* 4);
}
}
}