Commit 72836e91 authored by Nathan Lee's avatar Nathan Lee

Crashfix when importing/selecting large png

Uses size_t as per Thomas Holder's suggestion.
Fixes gitlab.com/inkscape/inkscape/issues/192.

(backported from 90705c91)
parent 74604458
......@@ -1240,7 +1240,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);
......@@ -1257,7 +1257,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);
......
......@@ -208,7 +208,7 @@ DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigned /*sticky*/)
unsigned char *const pixels = _pixbuf->pixels();
int width = _pixbuf->width();
int height = _pixbuf->height();
int rowstride = _pixbuf->rowstride();
size_t rowstride = _pixbuf->rowstride();
Geom::Point tp = p * _ctm.inverse();
Geom::Rect r = bounds();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment