diff --git a/3rdparty/poppler/git/CairoFontEngine.cc b/3rdparty/poppler/git/CairoFontEngine.cc index 45ef764..3a479e4 100644 --- a/3rdparty/poppler/git/CairoFontEngine.cc +++ b/3rdparty/poppler/git/CairoFontEngine.cc @@ -17,7 +17,7 @@ // Copyright (C) 2005-2007 Jeff Muizelaar // Copyright (C) 2005, 2006 Kristian Høgsberg // Copyright (C) 2005 Martin Kretzschmar -// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017, 2018 Albert Astals Cid +// Copyright (C) 2005, 2009, 2012, 2013, 2015, 2017-2019 Albert Astals Cid // Copyright (C) 2006, 2007, 2010, 2011 Carlos Garcia Campos // Copyright (C) 2007 Koji Otani // Copyright (C) 2008, 2009 Chris Wilson @@ -80,7 +80,7 @@ CairoFont::~CairoFont() { bool CairoFont::matches(Ref &other, bool printingA) { - return (other.num == ref.num && other.gen == ref.gen); + return (other == ref); } cairo_font_face_t * @@ -783,7 +783,7 @@ CairoType3Font::~CairoType3Font() { } bool CairoType3Font::matches(Ref &other, bool printingA) { - return (other.num == ref.num && other.gen == ref.gen && printing == printingA); + return (other == ref && printing == printingA); } diff --git a/3rdparty/poppler/git/CairoRescaleBox.cc b/3rdparty/poppler/git/CairoRescaleBox.cc index 9755438..2c0e1ed 100644 --- a/3rdparty/poppler/git/CairoRescaleBox.cc +++ b/3rdparty/poppler/git/CairoRescaleBox.cc @@ -34,6 +34,7 @@ // Copyright (C) 2012, 2017 Adrian Johnson // Copyright (C) 2018 Adam Reichold // Copyright (C) 2019 Albert Astals Cid +// Copyright (C) 2019 Marek Kasik // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -61,7 +62,7 @@ static void downsample_row_box_filter ( int start, int width, - uint32_t *src, uint32_t *dest, + uint32_t *src, uint32_t *src_limit, uint32_t *dest, int coverage[], int pixel_coverage) { /* we need an array of the pixel contribution of each destination pixel on the boundaries. @@ -89,13 +90,13 @@ static void downsample_row_box_filter ( /* skip to start */ /* XXX: it might be possible to do this directly instead of iteratively, however * the iterative solution is simple */ - while (x < start) + while (x < start && src < src_limit) { int box = 1 << FIXED_SHIFT; int start_coverage = coverage[x]; box -= start_coverage; src++; - while (box >= pixel_coverage) + while (box >= pixel_coverage && src < src_limit) { src++; box -= pixel_coverage; @@ -103,7 +104,7 @@ static void downsample_row_box_filter ( x++; } - while (x < start + width) + while (x < start + width && src < src_limit) { uint32_t a = 0; uint32_t r = 0; @@ -120,7 +121,7 @@ static void downsample_row_box_filter ( x++; box -= start_coverage; - while (box >= pixel_coverage) + while (box >= pixel_coverage && src < src_limit) { a += ((*src >> 24) & 0xff) * pixel_coverage; r += ((*src >> 16) & 0xff) * pixel_coverage; @@ -134,7 +135,7 @@ static void downsample_row_box_filter ( /* multiply by whatever is leftover * this ensures that we don't bias down. * i.e. start_coverage + n*pixel_coverage + box == 1 << 24 */ - if (box > 0) + if (box > 0 && src < src_limit) { a += ((*src >> 24) & 0xff) * box; r += ((*src >> 16) & 0xff) * box; @@ -226,10 +227,10 @@ static int compute_coverage (int coverage[], int src_length, int dest_length) /* I have a proof of this, which this margin is too narrow to contain */ for (i=0; i= pixel_coverage_y) { getRow(src_y, scanline); - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + downsample_row_box_filter (start_column, width, scanline, scanline + orig_width, temp_buf + width * columns, x_coverage, pixel_coverage_x); columns++; src_y++; box -= pixel_coverage_y; @@ -354,7 +355,7 @@ bool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, if (box > 0) { getRow(src_y, scanline); - downsample_row_box_filter (start_column, width, scanline, temp_buf + width * columns, x_coverage, pixel_coverage_x); + downsample_row_box_filter (start_column, width, scanline, scanline + orig_width, temp_buf + width * columns, x_coverage, pixel_coverage_x); columns++; }