From 90705c915973171ceb661d5494277fc21eb2ae8b Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 2 Jul 2019 21:36:58 +1000 Subject: Crashfix when importing/selecting large png Uses size_t as per Thomas Holder's suggestion. Fixes gitlab.com/inkscape/inkscape/issues/192. --- src/display/cairo-utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/display/cairo-utils.cpp') 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(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(data + i*stride); for (int j = 0; j < w; ++j) { *px = pixbuf_from_argb32(*px); -- cgit v1.2.3