diff --git a/SOURCES/poppler-0.26.5-add-font-substitute-name-to-qt-bindings.patch b/SOURCES/poppler-0.26.5-add-font-substitute-name-to-qt-bindings.patch new file mode 100644 index 0000000..0f5c608 --- /dev/null +++ b/SOURCES/poppler-0.26.5-add-font-substitute-name-to-qt-bindings.patch @@ -0,0 +1,60 @@ +diff --git a/qt4/src/poppler-fontinfo.cc b/qt4/src/poppler-fontinfo.cc +index 81aed71..a8ce1fc 100644 +--- a/qt4/src/poppler-fontinfo.cc ++++ b/qt4/src/poppler-fontinfo.cc +@@ -50,6 +50,11 @@ QString FontInfo::name() const + return m_data->fontName; + } + ++QString FontInfo::substituteName() const ++{ ++ return m_data->fontSubstituteName; ++} ++ + QString FontInfo::file() const + { + return m_data->fontFile; +diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h +index 0d11e83..f0e9fa4 100644 +--- a/qt4/src/poppler-private.h ++++ b/qt4/src/poppler-private.h +@@ -162,6 +162,7 @@ namespace Poppler { + FontInfoData( const FontInfoData &fid ) + { + fontName = fid.fontName; ++ fontSubstituteName = fid.fontSubstituteName; + fontFile = fid.fontFile; + isEmbedded = fid.isEmbedded; + isSubset = fid.isSubset; +@@ -172,6 +173,7 @@ namespace Poppler { + FontInfoData( ::FontInfo* fi ) + { + if (fi->getName()) fontName = fi->getName()->getCString(); ++ if (fi->getSubstituteName()) fontSubstituteName = fi->getSubstituteName()->getCString(); + if (fi->getFile()) fontFile = fi->getFile()->getCString(); + isEmbedded = fi->getEmbedded(); + isSubset = fi->getSubset(); +@@ -180,6 +182,7 @@ namespace Poppler { + } + + QString fontName; ++ QString fontSubstituteName; + QString fontFile; + bool isEmbedded : 1; + bool isSubset : 1; +diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h +index 30295cf..d38a4a3 100644 +--- a/qt4/src/poppler-qt4.h ++++ b/qt4/src/poppler-qt4.h +@@ -202,6 +202,11 @@ namespace Poppler { + */ + QString name() const; + ++ /** ++ The name of the substitute font. Can be QString::null if the font has no substitute font ++ */ ++ QString substituteName() const; ++ + /** + The path of the font file used to represent this font on this system, + or a null string is the font is embedded diff --git a/SOURCES/poppler-0.26.5-color-space.patch b/SOURCES/poppler-0.26.5-color-space.patch new file mode 100644 index 0000000..29e94c7 --- /dev/null +++ b/SOURCES/poppler-0.26.5-color-space.patch @@ -0,0 +1,106 @@ +--- poppler-0.26.5/poppler/CairoOutputDev.cc ++++ poppler-0.26.5/poppler/CairoOutputDev.cc +@@ -2571,7 +2571,11 @@ void CairoOutputDev::drawSoftMaskedImage + + cairo_surface_mark_dirty (image); + ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x1, state, NULL); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x2, colorMap, NULL); + setMimeData(str, ref, image); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x2, NULL, NULL); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x1, NULL, NULL); + + pattern = cairo_pattern_create_for_surface (image); + cairo_surface_destroy (image); +@@ -2674,24 +2678,72 @@ GBool CairoOutputDev::getStreamData (Str + return gTrue; + } + ++static GBool colorMapHasIdentityDecodeMap(GfxImageColorMap *colorMap) ++{ ++ for (int i = 0; i < colorMap->getNumPixelComps(); i++) { ++ if (colorMap->getDecodeLow(i) != 0.0 || colorMap->getDecodeHigh(i) != 1.0) ++ return gFalse; ++ } ++ return gTrue; ++} ++ + void CairoOutputDev::setMimeData(Stream *str, Object *ref, cairo_surface_t *image) + { + char *strBuffer; + int len; + Object obj; ++ GfxColorSpace *colorSpace = NULL; ++ GfxState *state = NULL; ++ GfxImageColorMap *colorMap = NULL; ++ ++ if (image != NULL) ++ { ++ state = (GfxState *) cairo_surface_get_user_data(image, (const cairo_user_data_key_t *) 0x1); ++ colorMap = (GfxImageColorMap *) cairo_surface_get_user_data(image, (const cairo_user_data_key_t *) 0x2); ++ } + + if (!printing || !(str->getKind() == strDCT || str->getKind() == strJPX)) + return; + ++ if (state != NULL) { ++ str->getDict()->lookup("ColorSpace", &obj); ++ colorSpace = GfxColorSpace::parse(&obj, this, state); ++ obj.free(); ++ } ++ + // colorspace in stream dict may be different from colorspace in jpx + // data +- if (str->getKind() == strJPX) { +- GBool hasColorSpace = !str->getDict()->lookup("ColorSpace", &obj)->isNull(); +- obj.free(); +- if (hasColorSpace) ++ if (str->getKind() == strJPX && colorSpace) ++ { ++ delete colorSpace; + return; ++ } ++ ++ // only embed mime data for gray, rgb, and cmyk colorspaces. ++ if (colorSpace) { ++ GfxColorSpaceMode mode = colorSpace->getMode(); ++ delete colorSpace; ++ switch (mode) { ++ case csDeviceGray: ++ case csCalGray: ++ case csDeviceRGB: ++ case csCalRGB: ++ case csDeviceCMYK: ++ case csICCBased: ++ break; ++ ++ case csLab: ++ case csIndexed: ++ case csSeparation: ++ case csDeviceN: ++ case csPattern: ++ return; ++ } + } + ++ if (colorMap && !colorMapHasIdentityDecodeMap(colorMap)) ++ return; ++ + if (getStreamData (str->getNextStream(), &strBuffer, &len)) { + cairo_status_t st; + +@@ -2908,8 +2960,13 @@ void CairoOutputDev::drawImage(GfxState + if (width == widthA && height == heightA) + filter = getFilterForSurface (image, interpolate); + +- if (!inlineImg) /* don't read stream twice if it is an inline image */ ++ if (!inlineImg) { /* don't read stream twice if it is an inline image */ ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x1, state, NULL); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x2, colorMap, NULL); + setMimeData(str, ref, image); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x2, NULL, NULL); ++ cairo_surface_set_user_data(image, (const cairo_user_data_key_t *) 0x1, NULL, NULL); ++ } + + pattern = cairo_pattern_create_for_surface (image); + cairo_surface_destroy (image); diff --git a/SOURCES/poppler-0.26.5-coverage-values.patch b/SOURCES/poppler-0.26.5-coverage-values.patch new file mode 100644 index 0000000..74cb731 --- /dev/null +++ b/SOURCES/poppler-0.26.5-coverage-values.patch @@ -0,0 +1,35 @@ +From d716e636231c8d636bf2139896d817b66fe6d510 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Thu, 21 Mar 2019 13:15:37 +0100 +Subject: [PATCH 1/2] cairo: Compute correct coverage values for box filter + +Use double precision for computation of coverage +of the left most pixel in the box filter. + +Issue #736 +--- + poppler/CairoRescaleBox.cc | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/poppler/CairoRescaleBox.cc b/poppler/CairoRescaleBox.cc +index b8371a5b..d7615010 100644 +--- a/poppler/CairoRescaleBox.cc ++++ b/poppler/CairoRescaleBox.cc +@@ -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; igetEntry(objNum, gFalse); ++ if (entry) { ++ if (!entry->getFlag(XRefEntry::Parsing) || ++ (objNum == 0 && objGen == 0)) { ++ entry->setFlag(XRefEntry::Parsing, gTrue); ++ } else { ++ error(errSyntaxError, getPos(), ++ "Object '{0:d} {1:d} obj' is being already parsed", objNum, objGen); ++ return NULL; ++ } ++ } ++ } ++ + // get stream start position + lexer->skipToNextLine(); + if (!(str = lexer->getStream())) { +@@ -281,6 +295,16 @@ Stream *Parser::makeStream(Object *dict, + // get filters + str = str->addFilters(dict, recursion); + ++ if (xref) { ++ // Don't try to reuse the entry from the block at the start ++ // of the function, xref can change in the middle because of ++ // reconstruction ++ XRefEntry *entry = xref->getEntry(objNum, gFalse); ++ if (entry) { ++ entry->setFlag(XRefEntry::Parsing, gFalse); ++ } ++ } ++ + return str; + } + +diff --git a/poppler/XRef.h b/poppler/XRef.h +index 11ee5e03..2eb2f9fd 100644 +--- a/poppler/XRef.h ++++ b/poppler/XRef.h +@@ -72,7 +72,10 @@ struct XRefEntry { + + // Special flags -- available only after xref->scanSpecialFlags() is run + Unencrypted, // Entry is stored in unencrypted form (meaningless in unencrypted documents) +- DontRewrite // Entry must not be written back in case of full rewrite ++ DontRewrite, // Entry must not be written back in case of full rewrite ++ ++ // Regular flag (moved here to preserve values of previous flags) ++ Parsing // Entry is currently being parsed + }; + + inline GBool getFlag(Flag flag) { diff --git a/SOURCES/poppler-0.26.5-display-profile.patch b/SOURCES/poppler-0.26.5-display-profile.patch new file mode 100644 index 0000000..20b788c --- /dev/null +++ b/SOURCES/poppler-0.26.5-display-profile.patch @@ -0,0 +1,63 @@ +From e07c8b4784234383cb5ddcf1133ea91a772506e2 Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Tue, 1 Jan 2019 10:54:40 +0100 +Subject: [PATCH] Avoid global display profile state becoming an uncontrolled + memory leak by enforcing single initialization. Closes #654 + +--- + poppler/GfxState.cc | 9 +++++++++ + qt5/src/poppler-qt5.h | 4 ++++ + 2 files changed, 13 insertions(+) + +diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc +index 87b7ce03..4e3ccbfd 100644 +--- a/poppler/GfxState.cc ++++ b/poppler/GfxState.cc +@@ -226,6 +226,10 @@ static unsigned int getCMSNChannels(cmsColorSpaceSignature cs); + static cmsHPROFILE loadColorProfile(const char *fileName); + + void GfxColorSpace::setDisplayProfile(void *displayProfileA) { ++ if (displayProfile != NULL) { ++ error(errInternal, -1, "The display color profile can only be set once before any rendering is done."); ++ return; ++ } + displayProfile = displayProfileA; + if (displayProfile != NULL) { + cmsHTRANSFORM transform; +@@ -249,6 +253,11 @@ void GfxColorSpace::setDisplayProfile(void *displayProfileA) { + } + + void GfxColorSpace::setDisplayProfileName(GooString *name) { ++ if (displayProfile != NULL) { ++ error(errInternal, -1, "The display color profile can only be set before any rendering is done."); ++ return; ++ } ++ delete displayProfileName; + displayProfileName = name->copy(); + } + +diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h +index 4f06c47e..ddac7dfb 100644 +--- a/qt5/src/poppler-qt5.h ++++ b/qt5/src/poppler-qt5.h +@@ -1102,6 +1102,8 @@ delete it; + + \param outputProfileA is a \c cmsHPROFILE of the LCMS library. + ++ \note This should be called before any rendering happens and only once during the lifetime of the current process. ++ + \since 0.12 + */ + void setColorDisplayProfile(void *outputProfileA); +@@ -1110,6 +1112,8 @@ delete it; + + \param name is the name of the display profile to set. + ++ \note This should be called before any rendering happens. ++ + \since 0.12 + */ + void setColorDisplayProfileName(const QString &name); +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-dummy-xref-entry.patch b/SOURCES/poppler-0.26.5-dummy-xref-entry.patch new file mode 100644 index 0000000..bc1f5a1 --- /dev/null +++ b/SOURCES/poppler-0.26.5-dummy-xref-entry.patch @@ -0,0 +1,63 @@ +From 39a251b1b3a3343400a08e2f03c5518a26624626 Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Mon, 24 Dec 2018 15:40:38 +0100 +Subject: [PATCH] Do not try to parse into unallocated XRef entry and return + pointer to dummy entry instead. Closes #692 and oss-fuzz/12330 + +--- + poppler/XRef.cc | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +diff --git a/poppler/XRef.cc b/poppler/XRef.cc +index 0ec66944..d042d1f4 100644 +--- a/poppler/XRef.cc ++++ b/poppler/XRef.cc +@@ -1548,11 +1548,31 @@ void XRef::readXRefUntil(int untilEntryNum, std::vector *xrefStreamObjsNum) + } + } + ++namespace { ++ ++struct DummyXRefEntry : XRefEntry { ++ DummyXRefEntry() { ++ offset = 0; ++ gen = -1; ++ type = xrefEntryNone; ++ flags = 0; ++ } ++}; ++ ++DummyXRefEntry dummyXRefEntry; ++ ++} ++ + XRefEntry *XRef::getEntry(int i, GBool complainIfMissing) + { + if (i >= size || entries[i].type == xrefEntryNone) { + + if ((!xRefStream) && mainXRefEntriesOffset) { ++ if (unlikely(i >= capacity)) { ++ error(errInternal, -1, "Request for out-of-bounds XRef entry [{0:d}]", i); ++ return &dummyXRefEntry; ++ } ++ + if (!parseEntry(mainXRefEntriesOffset + 20*i, &entries[i])) { + error(errSyntaxError, -1, "Failed to parse XRef entry [{0:d}].", i); + } +@@ -1563,12 +1583,7 @@ XRefEntry *XRef::getEntry(int i, bool complainIfMissing) + // We might have reconstructed the xref + // Check again i is in bounds + if (unlikely(i >= size)) { +- static XRefEntry dummy; +- dummy.offset = 0; +- dummy.gen = -1; +- dummy.type = xrefEntryNone; +- dummy.flags = 0; +- return &dummy; ++ return &dummyXRefEntry; + } + + if (entries[i].type == xrefEntryNone) { +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-embedded-file-check.patch b/SOURCES/poppler-0.26.5-embedded-file-check.patch new file mode 100644 index 0000000..f6fd7c7 --- /dev/null +++ b/SOURCES/poppler-0.26.5-embedded-file-check.patch @@ -0,0 +1,77 @@ +From 614514f577bbe676f736afcd8065892df8391315 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Fri, 20 Apr 2018 11:38:13 +0200 +Subject: [PATCH] Fix crash on missing embedded file + +Check whether an embedded file is actually present in the PDF +and show warning in that case. + +https://bugs.freedesktop.org/show_bug.cgi?id=106137 +https://gitlab.freedesktop.org/poppler/poppler/issues/236 +--- + glib/poppler-attachment.cc | 26 +++++++++++++++++--------- + glib/poppler-document.cc | 3 ++- + 2 files changed, 19 insertions(+), 10 deletions(-) + +diff --git a/glib/poppler-attachment.cc b/glib/poppler-attachment.cc +index c6502e9d..11ba5bb5 100644 +--- a/glib/poppler-attachment.cc ++++ b/glib/poppler-attachment.cc +@@ -111,20 +111,28 @@ _poppler_attachment_new (FileSpec *emb_file) + attachment->description = _poppler_goo_string_to_utf8 (emb_file->getDescription ()); + + embFile = emb_file->getEmbeddedFile(); +- attachment->size = embFile->size (); ++ if (embFile != NULL && embFile->isOk()) ++ { ++ attachment->size = embFile->size (); + +- if (embFile->createDate ()) +- _poppler_convert_pdf_date_to_gtime (embFile->createDate (), (time_t *)&attachment->ctime); +- if (embFile->modDate ()) +- _poppler_convert_pdf_date_to_gtime (embFile->modDate (), (time_t *)&attachment->mtime); ++ if (embFile->createDate ()) ++ _poppler_convert_pdf_date_to_gtime (embFile->createDate (), (time_t *)&attachment->ctime); ++ if (embFile->modDate ()) ++ _poppler_convert_pdf_date_to_gtime (embFile->modDate (), (time_t *)&attachment->mtime); + +- if (embFile->checksum () && embFile->checksum ()->getLength () > 0) +- attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (), +- embFile->checksum ()->getLength ()); +- priv->obj_stream = new Object(); +- priv->obj_stream->initStream(embFile->stream()); +- // Copy the stream +- embFile->stream()->incRef(); ++ if (embFile->checksum () && embFile->checksum ()->getLength () > 0) ++ attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (), ++ embFile->checksum ()->getLength ()); ++ priv->obj_stream = new Object(); ++ priv->obj_stream->initStream(embFile->stream()); ++ // Copy the stream ++ embFile->stream()->incRef(); ++ } ++ else ++ { ++ g_warning ("Missing stream object for embedded file"); ++ g_clear_object (&attachment); ++ } + + return attachment; + } +diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc +index b343eb90..df0aa47f 100644 +--- a/glib/poppler-document.cc ++++ b/glib/poppler-document.cc +@@ -666,7 +666,8 @@ poppler_document_get_attachments (PopplerDocument *document) + attachment = _poppler_attachment_new (emb_file); + delete emb_file; + +- retval = g_list_prepend (retval, attachment); ++ if (attachment != NULL) ++ retval = g_list_prepend (retval, attachment); + } + return g_list_reverse (retval); + } +-- +2.17.0 + diff --git a/SOURCES/poppler-0.26.5-filespec.patch b/SOURCES/poppler-0.26.5-filespec.patch new file mode 100644 index 0000000..d33f87f --- /dev/null +++ b/SOURCES/poppler-0.26.5-filespec.patch @@ -0,0 +1,34 @@ +From de0c0b8324e776f0b851485e0fc9622fc35695b7 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Sat, 29 Dec 2018 01:25:17 +0100 +Subject: [PATCH] FileSpec: Move the fileSpec.dictLookup call inside + fileSpec.isDict if + +Fixes #704 +--- + poppler/FileSpec.cc | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc +index 8a8b9e7e..7c12da63 100644 +--- a/poppler/FileSpec.cc ++++ b/poppler/FileSpec.cc +@@ -137,11 +137,11 @@ FileSpec::FileSpec(Object *fileSpecA) + } + } + obj1.free(); +- } + +- if (fileSpec.dictLookup("Desc", &obj1)->isString()) +- desc = obj1.getString()->copy(); +- obj1.free(); ++ if (fileSpec.dictLookup("Desc", &obj1)->isString()) ++ desc = obj1.getString()->copy(); ++ obj1.free(); ++ } + } + + FileSpec::~FileSpec() +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-glib-print-scaling.patch b/SOURCES/poppler-0.26.5-glib-print-scaling.patch new file mode 100644 index 0000000..0566a2c --- /dev/null +++ b/SOURCES/poppler-0.26.5-glib-print-scaling.patch @@ -0,0 +1,182 @@ +From 75f3d31daa050ca822d2ab501cdeca748ddf9d54 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Wed, 2 Jan 2019 14:55:41 +0100 +Subject: glib: Make PrintScaling preference available in API + +Add poppler_document_get_print_scaling() function and +PopplerPrintScaling enum so that applications which +use poppler's glib frontend can access this preference. + +https://bugs.freedesktop.org/show_bug.cgi?id=92779 + +diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc +index d97d1448..ed37da4c 100644 +--- a/glib/poppler-document.cc ++++ b/glib/poppler-document.cc +@@ -36,6 +37,7 @@ + #include + #include + #include ++#include + #endif + + #include "poppler.h" +@@ -78,7 +80,8 @@ enum { + PROP_PAGE_MODE, + PROP_VIEWER_PREFERENCES, + PROP_PERMISSIONS, +- PROP_METADATA ++ PROP_METADATA, ++ PROP_PRINT_SCALING + }; + + static void poppler_document_layers_free (PopplerDocument *document); +@@ -1516,6 +1519,44 @@ poppler_document_get_page_mode (PopplerDocument *document) + return POPPLER_PAGE_MODE_UNSET; + } + ++/** ++ * poppler_document_get_print_scaling: ++ * @document: A #PopplerDocument ++ * ++ * Returns the print scaling value suggested by author of the document. ++ * ++ * Return value: a #PopplerPrintScaling that should be used when document is printed ++ * ++ * Since: 0.26.5 ++ **/ ++PopplerPrintScaling ++poppler_document_get_print_scaling (PopplerDocument *document) ++{ ++ Catalog *catalog; ++ ViewerPreferences *preferences; ++ PopplerPrintScaling print_scaling = POPPLER_PRINT_SCALING_APP_DEFAULT; ++ ++ g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), POPPLER_PRINT_SCALING_APP_DEFAULT); ++ ++ catalog = document->doc->getCatalog (); ++ if (catalog && catalog->isOk ()) { ++ preferences = catalog->getViewerPreferences(); ++ if (preferences) { ++ switch (preferences->getPrintScaling()) { ++ default: ++ case ViewerPreferences::printScalingAppDefault: ++ print_scaling = POPPLER_PRINT_SCALING_APP_DEFAULT; ++ break; ++ case ViewerPreferences::printScalingNone: ++ print_scaling = POPPLER_PRINT_SCALING_NONE; ++ break; ++ } ++ } ++ } ++ ++ return print_scaling; ++} ++ + /** + * poppler_document_get_permissions: + * @document: A #PopplerDocument +@@ -1746,6 +1787,9 @@ poppler_document_get_property (GObject *object, + /* FIXME: write... */ + g_value_set_flags (value, POPPLER_VIEWER_PREFERENCES_UNSET); + break; ++ case PROP_PRINT_SCALING: ++ g_value_set_enum (value, poppler_document_get_print_scaling (document)); ++ break; + case PROP_PERMISSIONS: + g_value_set_flags (value, poppler_document_get_permissions (document)); + break; +@@ -2013,6 +2057,20 @@ poppler_document_class_init (PopplerDocumentClass *klass) + POPPLER_VIEWER_PREFERENCES_UNSET, + G_PARAM_READABLE)); + ++ /** ++ * PopplerDocument:print-scaling: ++ * ++ * Since: 0.26.5 ++ */ ++ g_object_class_install_property (G_OBJECT_CLASS (klass), ++ PROP_PRINT_SCALING, ++ g_param_spec_enum ("print-scaling", ++ "Print Scaling", ++ "Print Scaling Viewer Preference", ++ POPPLER_TYPE_PRINT_SCALING, ++ POPPLER_PRINT_SCALING_APP_DEFAULT, ++ (GParamFlags) (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS))); ++ + /** + * PopplerDocument:permissions: + * +diff --git a/glib/poppler-document.h b/glib/poppler-document.h +index ebf3a9e1..e9eeebfd 100644 +--- a/glib/poppler-document.h ++++ b/glib/poppler-document.h +@@ -135,6 +136,21 @@ typedef enum /*< flags >*/ + POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL = 1 << 6 + } PopplerViewerPreferences; + ++/** ++ * PopplerPrintScaling: ++ * @POPPLER_PRINT_SCALING_APP_DEFAULT: application's default page scaling ++ * @POPPLER_PRINT_SCALING_NONE: no page scaling ++ * ++ * PrintScaling viewer preference ++ * ++ * Since: 0.26.5 ++ */ ++typedef enum ++{ ++ POPPLER_PRINT_SCALING_APP_DEFAULT, ++ POPPLER_PRINT_SCALING_NONE ++} PopplerPrintScaling; ++ + /** + * PopplerPermissions: + * @POPPLER_PERMISSIONS_OK_TO_PRINT: document can be printer +@@ -356,6 +372,7 @@ POPPLER_PUBLIC + PopplerPageMode poppler_document_get_page_mode (PopplerDocument *document); + PopplerPermissions poppler_document_get_permissions (PopplerDocument *document); + gchar *poppler_document_get_metadata (PopplerDocument *document); ++PopplerPrintScaling poppler_document_get_print_scaling (PopplerDocument *document); + + /* Attachments */ + guint poppler_document_get_n_attachments (PopplerDocument *document); +diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt +index 39985553..c71c2776 100644 +--- a/glib/reference/poppler-sections.txt ++++ b/glib/reference/poppler-sections.txt +@@ -174,6 +174,7 @@ poppler_document_get_pdf_subtype_string + poppler_document_get_page_layout + poppler_document_get_page_mode + poppler_document_get_permissions ++poppler_document_get_print_scaling + poppler_document_get_metadata + poppler_document_is_linearized + poppler_document_get_n_pages +@@ -246,6 +247,7 @@ POPPLER_TYPE_PDF_CONFORMANCE + POPPLER_TYPE_PAGE_LAYOUT + POPPLER_TYPE_PAGE_MODE + POPPLER_TYPE_PERMISSIONS ++POPPLER_TYPE_PRINT_SCALING + POPPLER_TYPE_VIEWER_PREFERENCES + + +@@ -260,6 +262,7 @@ poppler_pdf_conformance_get_type + poppler_page_layout_get_type + poppler_page_mode_get_type + poppler_permissions_get_type ++poppler_print_scaling_get_type + poppler_viewer_preferences_get_type + + +diff --git a/glib/reference/poppler.types b/glib/reference/poppler.types +index 354fdd3a..2f7a3991 100644 +--- a/glib/reference/poppler.types ++++ b/glib/reference/poppler.types +@@ -60,5 +60,6 @@ poppler_pdf_subtype_get_type + poppler_layer_get_type + poppler_media_get_type + poppler_movie_get_type ++poppler_print_scaling_get_type + poppler_structure_element_get_type + poppler_structure_element_iter_get_type diff --git a/SOURCES/poppler-0.26.5-image-stream-getline.patch b/SOURCES/poppler-0.26.5-image-stream-getline.patch new file mode 100644 index 0000000..ce20c07 --- /dev/null +++ b/SOURCES/poppler-0.26.5-image-stream-getline.patch @@ -0,0 +1,27 @@ +From f4136a6353162db249f63ddb0f20611622ab61b4 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Wed, 27 Feb 2019 19:43:22 +0100 +Subject: [PATCH] ImageStream::getLine: fix crash on broken files + +Fixes #728 +--- + poppler/Stream.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/poppler/Stream.cc b/poppler/Stream.cc +index 33537b0e..a41435ab 100644 +--- a/poppler/Stream.cc ++++ b/poppler/Stream.cc +@@ -496,6 +496,9 @@ unsigned char *ImageStream::getLine() { + } + + int readChars = str->doGetChars(inputLineSize, inputLine); ++ if (unlikely(readChars == -1)) { ++ readChars = 0; ++ } + for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF; + if (nBits == 1) { + p = inputLine; +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-negative-xref-indices.patch b/SOURCES/poppler-0.26.5-negative-xref-indices.patch new file mode 100644 index 0000000..d0cf40d --- /dev/null +++ b/SOURCES/poppler-0.26.5-negative-xref-indices.patch @@ -0,0 +1,29 @@ +From b54e1fc3e0d2600621a28d50f9f085b9e38619c2 Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Fri, 1 Feb 2019 08:42:27 +0100 +Subject: [PATCH] Also defend against requests for negative XRef indices. + oss-fuzz/12797 + +--- + poppler/XRef.cc | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/poppler/XRef.cc b/poppler/XRef.cc +index d042d1f4..ac2cd0ce 100644 +--- a/poppler/XRef.cc ++++ b/poppler/XRef.cc +@@ -1565,6 +1565,11 @@ DummyXRefEntry dummyXRefEntry; + + XRefEntry *XRef::getEntry(int i, GBool complainIfMissing) + { ++ if (unlikely(i < 0)) { ++ error(errInternal, -1, "Request for invalid XRef entry [{0:d}]", i); ++ return &dummyXRefEntry; ++ } ++ + if (i >= size || entries[i].type == xrefEntryNone) { + + if ((!xRefStream) && mainXRefEntriesOffset) { +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-pdfunite-missing-pages.patch b/SOURCES/poppler-0.26.5-pdfunite-missing-pages.patch new file mode 100644 index 0000000..7c4668e --- /dev/null +++ b/SOURCES/poppler-0.26.5-pdfunite-missing-pages.patch @@ -0,0 +1,15 @@ +--- poppler-0.26.5/utils/pdfunite.cc.the 2014-07-25 00:28:01.000000000 +0200 ++++ poppler-0.26.5/utils/pdfunite.cc 2019-02-20 11:37:39.405536641 +0100 +@@ -80,6 +80,12 @@ int main (int argc, char *argv[]) + GooString *gfileName = new GooString(argv[i]); + PDFDoc *doc = new PDFDoc(gfileName, NULL, NULL, NULL); + if (doc->isOk() && !doc->isEncrypted()) { ++ for (j = 1; j <= doc->getNumPages(); j++) { ++ if (doc->getCatalog()->getPage(j) == NULL) { ++ error(errSyntaxError, -1, "Page number {0:d} is missing in '{1:s}')", j, argv[i]); ++ return -1; ++ } ++ } + docs.push_back(doc); + if (doc->getPDFMajorVersion() > majorVersion) { + majorVersion = doc->getPDFMajorVersion(); diff --git a/SOURCES/poppler-0.26.5-rescale-filter.patch b/SOURCES/poppler-0.26.5-rescale-filter.patch new file mode 100644 index 0000000..3dbad5c --- /dev/null +++ b/SOURCES/poppler-0.26.5-rescale-filter.patch @@ -0,0 +1,100 @@ +From 8122f6d6d409b53151a20c5578fc525ee97315e8 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Thu, 21 Mar 2019 13:47:51 +0100 +Subject: [PATCH 2/2] cairo: Constrain number of cycles in rescale filter + +Pass address of the first byte after end of the source buffer +to downsample_row_box_filter() so that we can check +that we don't run out of it. + +Fixes issue #736 +--- + poppler/CairoRescaleBox.cc | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/poppler/CairoRescaleBox.cc b/poppler/CairoRescaleBox.cc +index d7615010..7fd07041 100644 +--- a/poppler/CairoRescaleBox.cc ++++ b/poppler/CairoRescaleBox.cc +@@ -62,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. +@@ -90,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; +@@ -104,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; +@@ -121,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; +@@ -135,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; +@@ -337,7 +337,7 @@ bool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, + int start_coverage_y = y_coverage[dest_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 -= start_coverage_y; +@@ -345,7 +345,7 @@ bool CairoRescaleBox::downScaleImage(unsigned orig_width, unsigned orig_height, + while (box >= 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; +@@ -355,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++; + } + +-- +2.20.1 + diff --git a/SOURCES/poppler-0.26.5-stream-check.patch b/SOURCES/poppler-0.26.5-stream-check.patch new file mode 100644 index 0000000..3a4ba07 --- /dev/null +++ b/SOURCES/poppler-0.26.5-stream-check.patch @@ -0,0 +1,28 @@ +From 6912e06d9ab19ba28991b5cab3319d61d856bd6d Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Tue, 6 Nov 2018 09:00:02 +0100 +Subject: [PATCH] Check for stream before calling stream methods when saving an + embedded file. + +Closes #659 +--- + poppler/FileSpec.cc | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc +index 7479c2d2..d5543041 100644 +--- a/poppler/FileSpec.cc ++++ b/poppler/FileSpec.cc +@@ -93,6 +93,9 @@ bool EmbFile::save(const char *path) { + GBool EmbFile::save2(FILE *f) { + int c; + ++ if (unlikely(!m_objStr.isStream())) ++ return false; ++ + m_objStr.streamReset(); + while ((c = m_objStr.streamGetChar()) != EOF) { + fputc(c, f); +-- +2.19.1 + diff --git a/SOURCES/poppler-0.26.5-tiling-patterns.patch b/SOURCES/poppler-0.26.5-tiling-patterns.patch new file mode 100644 index 0000000..dc343ac --- /dev/null +++ b/SOURCES/poppler-0.26.5-tiling-patterns.patch @@ -0,0 +1,97 @@ +--- poppler-0.26.5/poppler/CairoOutputDev.cc ++++ poppler-0.26.5/poppler/CairoOutputDev.cc +@@ -837,11 +837,17 @@ GBool CairoOutputDev::tilingPatternFill( + cairo_pattern_t *pattern; + cairo_surface_t *surface; + cairo_matrix_t matrix; ++ cairo_matrix_t pattern_matrix; + cairo_t *old_cairo; + double xMin, yMin, xMax, yMax; + double width, height; ++ double scaleX, scaleY; + int surface_width, surface_height; + StrokePathClip *strokePathTmp; ++ GBool adjusted_stroke_width_tmp; ++ cairo_pattern_t *maskTmp; ++ double xoffset, yoffset; ++ double det; + + width = bbox[2] - bbox[0]; + height = bbox[3] - bbox[1]; +@@ -850,8 +856,20 @@ GBool CairoOutputDev::tilingPatternFill( + return gFalse; + /* TODO: implement the other cases here too */ + +- surface_width = (int) ceil (width); +- surface_height = (int) ceil (height); ++ // Find the width and height of the transformed pattern ++ cairo_get_matrix (cairo, &matrix); ++ cairo_matrix_init (&pattern_matrix, mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); ++ cairo_matrix_multiply (&matrix, &matrix, &pattern_matrix); ++ ++ double widthX = width, widthY = 0; ++ cairo_matrix_transform_distance (&matrix, &widthX, &widthY); ++ surface_width = ceil (sqrt (widthX * widthX + widthY * widthY)); ++ ++ double heightX = 0, heightY = height; ++ cairo_matrix_transform_distance (&matrix, &heightX, &heightY); ++ surface_height = ceil (sqrt (heightX * heightX + heightY * heightY)); ++ scaleX = surface_width / width; ++ scaleY = surface_height / height; + + surface = cairo_surface_create_similar (cairo_get_target (cairo), + CAIRO_CONTENT_COLOR_ALPHA, +@@ -865,9 +883,15 @@ GBool CairoOutputDev::tilingPatternFill( + + box.x1 = bbox[0]; box.y1 = bbox[1]; + box.x2 = bbox[2]; box.y2 = bbox[3]; ++ cairo_scale (cairo, scaleX, scaleY); ++ cairo_translate (cairo, -box.x1, -box.y1); ++ + strokePathTmp = strokePathClip; +- strokePathClip = NULL; +- gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL, gfxA->getXRef()); ++ strokePathClip = NULL; ++ adjusted_stroke_width_tmp = adjusted_stroke_width; ++ maskTmp = mask; ++ mask = NULL; ++ gfx = new Gfx(doc, this, resDict, &box, NULL, NULL, NULL, gfxA->getXRef()); + if (paintType == 2) + inUncoloredPattern = gTrue; + gfx->display(str); +@@ -875,6 +899,8 @@ GBool CairoOutputDev::tilingPatternFill( + inUncoloredPattern = gFalse; + delete gfx; + strokePathClip = strokePathTmp; ++ adjusted_stroke_width = adjusted_stroke_width_tmp; ++ mask = maskTmp; + + pattern = cairo_pattern_create_for_surface (cairo_get_target (cairo)); + cairo_destroy (cairo); +@@ -882,14 +908,23 @@ GBool CairoOutputDev::tilingPatternFill( + if (cairo_pattern_status (pattern)) + return gFalse; + ++ det = pmat[0] * pmat[3] - pmat[1] * pmat[2]; ++ if (fabs(det) < 0.000001) ++ return gFalse; ++ ++ xoffset = round ((pmat[3] * pmat[4] - pmat[2] * pmat[5]) / (xStep * det)); ++ yoffset = - round ((pmat[1] * pmat[4] - pmat[0] * pmat[5]) / (yStep * det)); ++ pattern_matrix.x0 -= xoffset * pattern_matrix.xx * xStep + yoffset * pattern_matrix.xy * yStep; ++ pattern_matrix.y0 -= xoffset * pattern_matrix.yx * xStep + yoffset * pattern_matrix.yy * yStep; ++ + state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax); + cairo_rectangle (cairo, xMin, yMin, xMax - xMin, yMax - yMin); + +- cairo_matrix_init_scale (&matrix, surface_width / width, surface_height / height); ++ cairo_matrix_init_scale (&matrix, scaleX, scaleY); ++ cairo_matrix_translate (&matrix, -box.x1, -box.y1); + cairo_pattern_set_matrix (pattern, &matrix); + +- cairo_matrix_init (&matrix, mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); +- cairo_transform (cairo, &matrix); ++ cairo_transform (cairo, &pattern_matrix); + cairo_set_source (cairo, pattern); + cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); + if (strokePathClip) { diff --git a/SOURCES/poppler-0.26.5-valid-embedded-file-name.patch b/SOURCES/poppler-0.26.5-valid-embedded-file-name.patch new file mode 100644 index 0000000..6f0a841 --- /dev/null +++ b/SOURCES/poppler-0.26.5-valid-embedded-file-name.patch @@ -0,0 +1,81 @@ +From d2f5d424ba8752f9a9e9dad410546ec1b46caa0a Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Tue, 6 Nov 2018 09:08:06 +0100 +Subject: [PATCH] pdfdetach: Check for valid file name of embedded file before + using it to determine save path. + +Closes #660 +--- + utils/pdfdetach.cc | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc +index a8720c64..71fa8608 100644 +--- a/utils/pdfdetach.cc ++++ b/utils/pdfdetach.cc +@@ -191,14 +191,18 @@ int main(int argc, char *argv[]) { + fileSpec = static_cast(embeddedFiles->get(i)); + printf("%d: ", i+1); + s1 = fileSpec->getFileName(); +- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { ++ if (!s1) { ++ exitCode = 3; ++ goto err2; ++ } ++ if (s1->hasUnicodeMarker()) { + isUnicode = gTrue; + j = 2; + } else { + isUnicode = gFalse; + j = 0; + } +- while (j < fileSpec->getFileName()->getLength()) { ++ while (j < s1->getLength()) { + if (isUnicode) { + u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); + j += 2; +@@ -228,14 +232,18 @@ int main(int argc, char *argv[]) { + p = path; + } + s1 = fileSpec->getFileName(); +- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { ++ if (!s1) { ++ exitCode = 3; ++ goto err2; ++ } ++ if (s1->hasUnicodeMarker()) { + isUnicode = gTrue; + j = 2; + } else { + isUnicode = gFalse; + j = 0; + } +- while (j < fileSpec->getFileName()->getLength()) { ++ while (j < s1->getLength()) { + if (isUnicode) { + u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); + j += 2; +@@ -276,14 +284,18 @@ int main(int argc, char *argv[]) { + } else { + p = path; + s1 = fileSpec->getFileName(); +- if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { ++ if (!s1) { ++ exitCode = 3; ++ goto err2; ++ } ++ if (s1->hasUnicodeMarker()) { + isUnicode = gTrue; + j = 2; + } else { + isUnicode = gFalse; + j = 0; + } +- while (j < fileSpec->getFileName()->getLength()) { ++ while (j < s1->getLength()) { + if (isUnicode) { + u = ((s1->getChar(j) & 0xff) << 8) | (s1->getChar(j+1) & 0xff); + j += 2; +-- +2.19.1 + diff --git a/SOURCES/poppler-0.26.5-valid-embedded-file.patch b/SOURCES/poppler-0.26.5-valid-embedded-file.patch new file mode 100644 index 0000000..40938a7 --- /dev/null +++ b/SOURCES/poppler-0.26.5-valid-embedded-file.patch @@ -0,0 +1,46 @@ +From 77a30e94d96220d7e22dff5b3f0a7f296f01b118 Mon Sep 17 00:00:00 2001 +From: Adam Reichold +Date: Tue, 6 Nov 2018 09:13:41 +0100 +Subject: [PATCH] pdfdetach: Check for valid embedded file before trying to + save it. + +Closes #661 +--- + utils/pdfdetach.cc | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc +index 846584a4..a8720c64 100644 +--- a/utils/pdfdetach.cc ++++ b/utils/pdfdetach.cc +@@ -251,7 +251,12 @@ int main(int argc, char *argv[]) { + } + *p = '\0'; + +- if (!fileSpec->getEmbeddedFile()->save(path)) { ++ EmbFile *embFile = fileSpec->getEmbeddedFile(); ++ if (!embFile || !embFile->isOk()) { ++ exitCode = 3; ++ goto err2; ++ } ++ if (!embFile->save(path)) { + error(errIO, -1, "Error saving embedded file as '{0:s}'", p); + exitCode = 2; + goto err2; +@@ -296,7 +301,12 @@ int main(int argc, char *argv[]) { + p = path; + } + +- if (!fileSpec->getEmbeddedFile()->save(p)) { ++ EmbFile *embFile = fileSpec->getEmbeddedFile(); ++ if (!embFile || !embFile->isOk()) { ++ exitCode = 3; ++ goto err2; ++ } ++ if (!embFile->save(p)) { + error(errIO, -1, "Error saving embedded file as '{0:s}'", p); + exitCode = 2; + goto err2; +-- +2.19.1 + diff --git a/SPECS/poppler.spec b/SPECS/poppler.spec index eab104a..42ca775 100644 --- a/SPECS/poppler.spec +++ b/SPECS/poppler.spec @@ -1,7 +1,7 @@ Summary: PDF rendering library Name: poppler Version: 0.26.5 -Release: 20%{?dist} +Release: 38%{?dist} License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT Group: Development/Libraries URL: http://poppler.freedesktop.org/ @@ -69,6 +69,54 @@ Patch23: poppler-0.26.5-infinite-recursion.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1602838 Patch24: poppler-0.26.5-negative-object-number.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1626618 +# https://bugzilla.redhat.com/show_bug.cgi?id=1665266 +Patch25: poppler-0.26.5-cycles-in-pdf-parsing.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1649457 +Patch26: poppler-0.26.5-embedded-file-check.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1649435 +Patch27: poppler-0.26.5-stream-check.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1649440 +Patch28: poppler-0.26.5-valid-embedded-file.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1649450 +Patch29: poppler-0.26.5-valid-embedded-file-name.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1639595 +Patch30: poppler-0.26.5-add-font-substitute-name-to-qt-bindings.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1672419 +Patch31: poppler-0.26.5-dummy-xref-entry.patch +Patch32: poppler-0.26.5-negative-xref-indices.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1665263 +Patch33: poppler-0.26.5-filespec.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1665273 +Patch34: poppler-0.26.5-pdfunite-missing-pages.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1646546 +Patch35: poppler-0.26.5-display-profile.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1683632 +Patch36: poppler-0.26.5-image-stream-getline.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1636103 +Patch37: poppler-0.26.5-color-space.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1658304 +Patch38: poppler-0.26.5-glib-print-scaling.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1378961 +Patch39: poppler-0.26.5-tiling-patterns.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1686802 +Patch40: poppler-0.26.5-coverage-values.patch +Patch41: poppler-0.26.5-rescale-filter.patch + Requires: poppler-data >= 0.4.0 BuildRequires: automake libtool BuildRequires: gettext-devel @@ -209,6 +257,23 @@ Requires: %{name}%{?_isa} = %{version}-%{release} %patch22 -p1 -b .annotink %patch23 -p1 -b .infinite-recursion %patch24 -p1 -b .negative-object-number +%patch25 -p1 -b .cycles-in-pdf-parsing +%patch26 -p1 -b .embedded-file-check +%patch27 -p1 -b .stream-check +%patch28 -p1 -b .valid-embedded-file +%patch29 -p1 -b .valid-embedded-file-name +%patch30 -p1 -b .add-font-substitute-name-to-qt-bindings +%patch31 -p1 -b .dummy-xref-entry +%patch32 -p1 -b .negative-xref-indices +%patch33 -p1 -b .filespec +%patch34 -p1 -b .pdfunite-missing-pages +%patch35 -p1 -b .display-profile +%patch36 -p1 -b .image-getstream-getline +%patch37 -p1 -b .color-space +%patch38 -p1 -b .glib-print-scaling +%patch39 -p1 -b .tiling-pattern +%patch40 -p1 -b .coverage-values +%patch41 -p1 -b .rescale-filter # hammer to nuke rpaths, recheck on new releases autoreconf -i -f @@ -330,6 +395,82 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %changelog +* Fri Mar 29 2019 Marek Kasik - 0.26.5-38 +- Constrain number of cycles in rescale filter +- Compute correct coverage values for box filter +- Resolves: #1688417 + +* Wed Mar 20 2019 Marek Kasik - 0.26.5-37 +- Fix tiling patterns when pattern cell is too far +- Resolves: #1378961 + +* Mon Mar 18 2019 Marek Kasik - 0.26.5-36 +- Fix version from which PrintScaling is available +- Resolves: #1658304 + +* Mon Mar 18 2019 Marek Kasik - 0.26.5-35 +- Export PrintScaling viewer preference in glib frontend +- Related: #1658304 + +* Fri Mar 15 2019 Marek Kasik - 0.26.5-34 +- Fix a memory leak detected by Coverity Scan +- Related: #1636103 + +* Wed Mar 13 2019 Marek Kasik - 0.26.5-33 +- Only embed mime data for gray/rgb/cmyk colorspaces +- if image decode map is identity +- Resolves: #1636103 + +* Fri Mar 8 2019 Marek Kasik - 0.26.5-32 +- Fix possible crash on broken files in ImageStream::getLine() +- Resolves: #1685267 + +* Fri Mar 8 2019 Marek Kasik - 0.26.5-31 +- Avoid global display profile state becoming an uncontrolled +- memory leak +- Resolves: #1648860 + +* Fri Feb 22 2019 Marek Kasik - 0.26.5-30 +- Check for missing pages in documents passed to pdfunite +- Resolves: #1677348 + +* Fri Feb 22 2019 Marek Kasik - 0.26.5-29 +- Don't reuse "entry" in Parser::makeStream +- Resolves: #1677058 + +* Fri Feb 22 2019 Marek Kasik - 0.26.5-28 +- Move the fileSpec.dictLookup call inside fileSpec.isDict if +- Resolves: #1677029 + +* Fri Feb 22 2019 Marek Kasik - 0.26.5-27 +- Defend against requests for negative XRef indices +- Resolves: #1673700 + +* Tue Jan 15 2019 Jan Grulich - 0.26.5-26 +- Add font substituteName() getter to Qt bindings +- Resolves: bz#1639595 + +* Wed Nov 21 2018 Marek Kasik - 0.26.5-25 +- Check for valid file name of embedded file +- Resolves: #1651307 + +* Wed Nov 21 2018 Marek Kasik - 0.26.5-24 +- Check for valid embedded file before trying to save it +- Resolves: #1651306 + +* Wed Nov 21 2018 Marek Kasik - 0.26.5-23 +- Check for stream before calling stream methods +- when saving an embedded file +- Resolves: #1651305 + +* Wed Nov 21 2018 Marek Kasik - 0.26.5-22 +- Fix crash on missing embedded file +- Resolves: #1651309 + +* Tue Nov 13 2018 Marek Kasik - 0.26.5-21 +- Avoid cycles in PDF parsing +- Resolves: #1640295 + * Mon Jul 30 2018 Marek Kasik - 0.26.5-20 - Fix crash when Object has negative number (CVE-2018-13988) - Resolves: #1609036