From e53ba03787ddb2d67286c70942e32bbeab36e7e3 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Wed, 8 Nov 2017 21:07:45 +1030 Subject: [PATCH] cairo: don't overflow y * stride when accessing image data --- poppler/CairoOutputDev.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 43c604f0..cc8a161b 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1834,7 +1834,7 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, /* convert to a luminocity map */ uint32_t *source_data = (uint32_t*)cairo_image_surface_get_data(source); /* get stride in units of 32 bits */ - int stride = cairo_image_surface_get_stride(source)/4; + ptrdiff_t stride = cairo_image_surface_get_stride(source)/4; for (int y=0; y= width || scaledHeight >= height) { // No downscaling. Create cairo image containing the source image data. unsigned char *buffer; - int stride; + ptrdiff_t stride; image = cairo_image_surface_create (maskColors ? CAIRO_FORMAT_ARGB32 : -- 2.11.0