summaryrefslogtreecommitdiffstats
path: root/src/display/cairo-utils.cpp
diff options
context:
space:
mode:
authorNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-07-02 11:36:58 +0000
committerNathan Lee <2431820-nathanal@users.noreply.gitlab.com>2019-07-02 11:36:58 +0000
commit90705c915973171ceb661d5494277fc21eb2ae8b (patch)
treed3267356f73de142027e93a4300b163f1484aeb8 /src/display/cairo-utils.cpp
parentWITH_ASAN AddressSanitizer compile option (diff)
downloadinkscape-90705c915973171ceb661d5494277fc21eb2ae8b.tar.gz
inkscape-90705c915973171ceb661d5494277fc21eb2ae8b.zip
Crashfix when importing/selecting large png
Uses size_t as per Thomas Holder's suggestion. Fixes gitlab.com/inkscape/inkscape/issues/192.
Diffstat (limited to 'src/display/cairo-utils.cpp')
-rw-r--r--src/display/cairo-utils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp
index 0a1dbd3d6..b7ea59109 100644
--- a/src/display/cairo-utils.cpp
+++ b/src/display/cairo-utils.cpp
@@ -1420,7 +1420,7 @@ guint32 pixbuf_from_argb32(guint32 c)
void
convert_pixels_pixbuf_to_argb32(guchar *data, int w, int h, int stride)
{
- for (int i = 0; i < h; ++i) {
+ for (size_t i = 0; i < h; ++i) {
guint32 *px = reinterpret_cast<guint32*>(data + i*stride);
for (int j = 0; j < w; ++j) {
*px = argb32_from_pixbuf(*px);
@@ -1437,7 +1437,7 @@ convert_pixels_pixbuf_to_argb32(guchar *data, int w, int h, int stride)
void
convert_pixels_argb32_to_pixbuf(guchar *data, int w, int h, int stride)
{
- for (int i = 0; i < h; ++i) {
+ for (size_t i = 0; i < h; ++i) {
guint32 *px = reinterpret_cast<guint32*>(data + i*stride);
for (int j = 0; j < w; ++j) {
*px = pixbuf_from_argb32(*px);