From 76f8c54ff4e9dcad216d83d2dbf852ff000dde5c Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 02 2019 18:03:30 +0000 Subject: import poppler-0.26.5-41.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4fb0e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/poppler-0.26.5.tar.xz diff --git a/.poppler.metadata b/.poppler.metadata new file mode 100644 index 0000000..c6249a8 --- /dev/null +++ b/.poppler.metadata @@ -0,0 +1 @@ +12937666faee80bae397a8338a3357e864d77d53 SOURCES/poppler-0.26.5.tar.xz diff --git a/SOURCES/CVE-2017-9775-1.patch b/SOURCES/CVE-2017-9775-1.patch new file mode 100644 index 0000000..52fa1e4 --- /dev/null +++ b/SOURCES/CVE-2017-9775-1.patch @@ -0,0 +1,40 @@ +From e465d36b8ecf46b80af4ac6b941ae56eb4883a89 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Mon, 19 Jun 2017 23:35:29 +0200 +Subject: [PATCH] Fix crash on malformed files + +Bug #101502 +--- + poppler/GfxState.cc | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc +index b17925f..e6cd329 100644 +--- a/poppler/GfxState.cc ++++ b/poppler/GfxState.cc +@@ -4036,6 +4036,12 @@ void GfxUnivariateShading::getColor(double t, GfxColor *color) { + double out[gfxColorMaxComps]; + int i, nComps; + ++ if (unlikely(nFuncs < 1)) { ++ for (int i = 0; i < gfxColorMaxComps; i++) ++ color->c[i] = 0; ++ return; ++ } ++ + // NB: there can be one function with n outputs or n functions with + // one output each (where n = number of color components) + nComps = nFuncs * funcs[0]->getOutputSize(); +@@ -4089,6 +4095,9 @@ void GfxUnivariateShading::setupCache(const Matrix *ctm, + cacheBounds = NULL; + cacheSize = 0; + ++ if (unlikely(nFuncs < 1)) ++ return; ++ + // NB: there can be one function with n outputs or n functions with + // one output each (where n = number of color components) + nComps = nFuncs * funcs[0]->getOutputSize(); +-- +2.9.3 + diff --git a/SOURCES/CVE-2017-9775-2.patch b/SOURCES/CVE-2017-9775-2.patch new file mode 100644 index 0000000..f10c8ab --- /dev/null +++ b/SOURCES/CVE-2017-9775-2.patch @@ -0,0 +1,41 @@ +From d9c88e1c8892c79b8865a0dabdcc0d3ffd55c195 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Wed, 21 Jun 2017 00:56:38 +0200 +Subject: [PATCH] Fix crash in malformed documents + +--- + poppler/GfxState.cc | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc +index e6cd329..f61f812 100644 +--- a/poppler/GfxState.cc ++++ b/poppler/GfxState.cc +@@ -4034,18 +4034,18 @@ GfxUnivariateShading::~GfxUnivariateShading() { + + void GfxUnivariateShading::getColor(double t, GfxColor *color) { + double out[gfxColorMaxComps]; +- int i, nComps; ++ int i; ++ ++ // NB: there can be one function with n outputs or n functions with ++ // one output each (where n = number of color components) ++ const int nComps = nFuncs * funcs[0]->getOutputSize(); + +- if (unlikely(nFuncs < 1)) { ++ if (unlikely(nFuncs < 1 || nComps > gfxColorMaxComps)) { + for (int i = 0; i < gfxColorMaxComps; i++) + color->c[i] = 0; + return; + } + +- // NB: there can be one function with n outputs or n functions with +- // one output each (where n = number of color components) +- nComps = nFuncs * funcs[0]->getOutputSize(); +- + if (cacheSize > 0) { + double x, ix, *l, *u, *upper; + +-- +2.9.3 + diff --git a/SOURCES/CVE-2017-9776.patch b/SOURCES/CVE-2017-9776.patch new file mode 100644 index 0000000..77ef658 --- /dev/null +++ b/SOURCES/CVE-2017-9776.patch @@ -0,0 +1,22 @@ +From 55db66c69fd56826b8523710046deab1a8d14ba2 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Wed, 21 Jun 2017 00:55:20 +0200 +Subject: [PATCH] Fix crash in malformed documents + +--- + poppler/JBIG2Stream.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc +index 4853588..d89108c 100644 +--- a/poppler/JBIG2Stream.cc ++++ b/poppler/JBIG2Stream.cc +@@ -868,6 +868,8 @@ + oneByte = x0 == ((x1 - 1) & ~7); + + for (yy = y0; yy < y1; ++yy) { ++ if (unlikely((y + yy >= h) || (y + yy < 0))) ++ continue; + + // one byte per line -- need to mask both left and right side + if (oneByte) { diff --git a/SOURCES/poppler-0.22.5-rotated-words-selection.patch b/SOURCES/poppler-0.22.5-rotated-words-selection.patch new file mode 100644 index 0000000..87d553b --- /dev/null +++ b/SOURCES/poppler-0.22.5-rotated-words-selection.patch @@ -0,0 +1,285 @@ +From 0ab1f29d4ce315b0fca260c0e0f3007024d00342 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Tue, 28 Jan 2014 15:13:24 +0100 +Subject: [PATCH] TextOutputDev: Respect orientation when selecting words + +Take rotation into account when visiting selection. +This doesn't fix all problems (there are still problems +on line and block levels). + +https://bugs.freedesktop.org/show_bug.cgi?id=16619 +--- + poppler/TextOutputDev.cc | 193 ++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 150 insertions(+), 43 deletions(-) + +diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc +index 7c2ca78..e93908c 100644 +--- a/poppler/TextOutputDev.cc ++++ b/poppler/TextOutputDev.cc +@@ -173,6 +173,12 @@ + // Max distance between edge of text and edge of link border + #define hyperlinkSlack 2 + ++// Returns whether x is between a and b or equal to a or b. ++// a and b don't need to be sorted. ++#define XBetweenAB(x,a,b) (!(((x) > (a) && (x) > (b)) || \ ++ ((x) < (a) && (x) < (b))) ? \ ++ gTrue : gFalse) ++ + //------------------------------------------------------------------------ + // TextUnderline + //------------------------------------------------------------------------ +@@ -4222,11 +4228,37 @@ void TextSelectionSizer::visitLine (TextLine *line, + PDFRectangle *rect; + double x1, y1, x2, y2, margin; + +- margin = (line->yMax - line->yMin) / 8; +- x1 = line->edge[edge_begin]; +- y1 = line->yMin - margin; +- x2 = line->edge[edge_end]; +- y2 = line->yMax + margin; ++ switch (line->rot) { ++ default: ++ case 0: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_begin]; ++ x2 = line->edge[edge_end]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 1: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_begin]; ++ y2 = line->edge[edge_end]; ++ break; ++ case 2: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_end]; ++ x2 = line->edge[edge_begin]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 3: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_end]; ++ y2 = line->edge[edge_begin]; ++ break; ++ } + + rect = new PDFRectangle (floor (x1 * scale), + floor (y1 * scale), +@@ -4310,19 +4341,56 @@ void TextSelectionPainter::visitLine (TextLine *line, + { + double x1, y1, x2, y2, margin; + +- margin = (line->yMax - line->yMin) / 8; +- x1 = floor (line->edge[edge_begin]); +- y1 = floor (line->yMin - margin); +- x2 = ceil (line->edge[edge_end]); +- y2 = ceil (line->yMax + margin); ++ switch (line->rot) { ++ default: ++ case 0: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_begin]; ++ x2 = line->edge[edge_end]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 1: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_begin]; ++ y2 = line->edge[edge_end]; ++ break; ++ case 2: ++ margin = (line->yMax - line->yMin) / 8; ++ x1 = line->edge[edge_end]; ++ x2 = line->edge[edge_begin]; ++ y1 = line->yMin - margin; ++ y2 = line->yMax + margin; ++ break; ++ case 3: ++ margin = (line->xMax - line->xMin) / 8; ++ x1 = line->xMin - margin; ++ x2 = line->xMax + margin; ++ y1 = line->edge[edge_end]; ++ y2 = line->edge[edge_begin]; ++ break; ++ } ++ ++ ctm.transform(x1, y1, &x1, &y1); ++ ctm.transform(x2, y2, &x2, &y2); + +- ctm.transform(line->edge[edge_begin], line->yMin - margin, &x1, &y1); +- ctm.transform(line->edge[edge_end], line->yMax + margin, &x2, &y2); ++ if (x1 < x2) { ++ x1 = floor (x1); ++ x2 = ceil (x2); ++ } else { ++ x1 = ceil (x1); ++ x2 = floor (x2); ++ } + +- x1 = floor (x1); +- y1 = floor (y1); +- x2 = ceil (x2); +- y2 = ceil (y2); ++ if (y1 < y2) { ++ y1 = floor (y1); ++ y2 = ceil (y2); ++ } else { ++ y1 = ceil (y1); ++ y2 = floor (y2); ++ } + + ictm.transform(x1, y1, &x1, &y1); + ictm.transform(x2, y2, &x2, &y2); +@@ -4400,17 +4467,27 @@ void TextWord::visitSelection(TextSelectionVisitor *visitor, + SelectionStyle style) + { + int i, begin, end; +- double mid; ++ double mid, s1, s2; ++ ++ if (rot == 0 || rot == 2) { ++ s1 = selection->x1; ++ s2 = selection->x2; ++ } else { ++ s1 = selection->y1; ++ s2 = selection->y2; ++ } + + begin = len; + end = 0; + for (i = 0; i < len; i++) { + mid = (edge[i] + edge[i + 1]) / 2; +- if (selection->x1 < mid || selection->x2 < mid) +- if (i < begin) +- begin = i; +- if (mid < selection->x1 || mid < selection->x2) +- end = i + 1; ++ if (XBetweenAB (mid, s1, s2)) ++ { ++ if (i < begin) ++ begin = i; ++ ++ end = i + 1; ++ } + } + + /* Skip empty selection. */ +@@ -4426,30 +4503,41 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, + TextWord *p, *begin, *end, *current; + int i, edge_begin, edge_end; + PDFRectangle child_selection; ++ double s1, s2, p_min, p_max; ++ ++ if (rot == 0 || rot == 2) { ++ s1 = selection->x1; ++ s2 = selection->x2; ++ } else { ++ s1 = selection->y1; ++ s2 = selection->y2; ++ } + + begin = NULL; + end = NULL; + current = NULL; + for (p = words; p != NULL; p = p->next) { ++ if (rot == 0 || rot == 2) { ++ p_min = p->xMin; ++ p_max = p->xMax; ++ } else { ++ p_min = p->yMin; ++ p_max = p->yMax; ++ } ++ + if (blk->page->primaryLR) { +- if ((selection->x1 < p->xMax) || +- (selection->x2 < p->xMax)) +- if (begin == NULL) +- begin = p; ++ if (((s1 < p_max) || (s2 < p_max)) && begin == NULL) ++ begin = p; + +- if (((selection->x1 > p->xMin) || +- (selection->x2 > p->xMin)) && (begin != NULL)) { ++ if (((s1 > p_min) || (s2 > p_min)) && begin != NULL) { + end = p->next; + current = p; + } + } else { +- if ((selection->x1 > p->xMin) || +- (selection->x2 > p->xMin)) +- if (begin == NULL) +- begin = p; ++ if (((s1 > p_min) || (s2 > p_min)) && begin == NULL) ++ begin = p; + +- if (((selection->x1 < p->xMax) || +- (selection->x2 < p->xMax)) && (begin != NULL)) { ++ if (((s1 < p_max) || (s2 < p_max)) && begin != NULL) { + end = p->next; + current = p; + } +@@ -4461,23 +4549,42 @@ void TextLine::visitSelection(TextSelectionVisitor *visitor, + + child_selection = *selection; + if (style == selectionStyleWord) { +- child_selection.x1 = begin ? begin->xMin : xMin; +- if (end && end->xMax != -1) { +- child_selection.x2 = current->xMax; ++ if (rot == 0 || rot == 2) { ++ child_selection.x1 = begin ? begin->xMin : xMin; ++ if (end && end->xMax != -1) { ++ child_selection.x2 = current->xMax; ++ } else { ++ child_selection.x2 = xMax; ++ } + } else { +- child_selection.x2 = xMax; ++ child_selection.y1 = begin ? begin->yMin : yMin; ++ if (end && end->yMax != -1) { ++ child_selection.y2 = current->yMax; ++ } else { ++ child_selection.y2 = yMax; ++ } + } + } + ++ if (rot == 0 || rot == 2) { ++ s1 = child_selection.x1; ++ s2 = child_selection.x2; ++ } else { ++ s1 = child_selection.y1; ++ s2 = child_selection.y2; ++ } ++ + edge_begin = len; + edge_end = 0; + for (i = 0; i < len; i++) { + double mid = (edge[i] + edge[i + 1]) / 2; +- if (child_selection.x1 < mid || child_selection.x2 < mid) +- if (i < edge_begin) +- edge_begin = i; +- if (mid < child_selection.x2 || mid < child_selection.x1) +- edge_end = i + 1; ++ if (XBetweenAB (mid, s1, s2)) ++ { ++ if (i < edge_begin) ++ edge_begin = i; ++ ++ edge_end = i + 1; ++ } + } + + /* Skip empty selection. */ +-- +1.8.4.2 + diff --git a/SOURCES/poppler-0.26.2-fofitype1.patch b/SOURCES/poppler-0.26.2-fofitype1.patch new file mode 100644 index 0000000..64876e8 --- /dev/null +++ b/SOURCES/poppler-0.26.2-fofitype1.patch @@ -0,0 +1,21 @@ +commit f966b8766d40b2c912e69a1e17ef8cc4bd52be95 +Author: Carlos Garcia Campos +Date: Tue Oct 21 16:42:27 2014 +0200 + + fofi: Fix a crash when parsing an invalid font due to a integer overflow + + This fixes a crash rendering trust_metrics.f2495.f0.pdf. + +diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc +index 8fa10a0..2245184 100644 +--- a/fofi/FoFiType1.cc ++++ b/fofi/FoFiType1.cc +@@ -263,7 +263,7 @@ void FoFiType1::parse() { + } else { + break; + } +- for (; *p >= '0' && *p < '0' + base; ++p) { ++ for (; *p >= '0' && *p < '0' + base && code < INT_MAX / (base + (*p - '0')); ++p) { + code = code * base + (*p - '0'); + } + for (; *p == ' ' || *p == '\t'; ++p) ; diff --git a/SOURCES/poppler-0.26.2-invalid-matrix.patch b/SOURCES/poppler-0.26.2-invalid-matrix.patch new file mode 100644 index 0000000..1ff0143 --- /dev/null +++ b/SOURCES/poppler-0.26.2-invalid-matrix.patch @@ -0,0 +1,43 @@ +From acc33a6950031ac4a5c759d043d24df0cfa7e8b6 Mon Sep 17 00:00:00 2001 +From: Jason Crain +Date: Sat, 20 Dec 2014 02:24:49 -0600 +Subject: [PATCH] Check for invalid matrix in annotation + +Bug #84990 +--- + poppler/Gfx.cc | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc +index 64a9d7b..77693f9 100644 +--- a/poppler/Gfx.cc ++++ b/poppler/Gfx.cc +@@ -37,6 +37,7 @@ + // Copyright (C) 2012 Even Rouault + // Copyright (C) 2012, 2013 Fabio D'Urso + // Copyright (C) 2012 Lu Wang ++// Copyright (C) 2014 Jason Crain + // + // 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 +@@ -5285,8 +5286,15 @@ void Gfx::drawAnnot(Object *str, AnnotBorder *border, AnnotColor *aColor, + if (matrixObj.isArray() && matrixObj.arrayGetLength() >= 6) { + for (i = 0; i < 6; ++i) { + matrixObj.arrayGet(i, &obj1); +- m[i] = obj1.getNum(); +- obj1.free(); ++ if (likely(obj1.isNum())) { ++ m[i] = obj1.getNum(); ++ obj1.free(); ++ } else { ++ obj1.free(); ++ matrixObj.free(); ++ error(errSyntaxError, getPos(), "Bad form matrix"); ++ return; ++ } + } + } else { + m[0] = 1; m[1] = 0; +-- +2.1.0 + diff --git a/SOURCES/poppler-0.26.2-pdfdetach.patch b/SOURCES/poppler-0.26.2-pdfdetach.patch new file mode 100644 index 0000000..e7eebde --- /dev/null +++ b/SOURCES/poppler-0.26.2-pdfdetach.patch @@ -0,0 +1,26 @@ +From 88dbd4df0998233939b4a51cedbfc65c58a315f9 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +Date: Sun, 19 Oct 2014 22:47:15 +1030 +Subject: [PATCH] pdfdetach: fix crash when getPage() returns null + +Bug 85145 +--- + utils/pdfdetach.cc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/utils/pdfdetach.cc b/utils/pdfdetach.cc +index 4f67fd7..3bae3c0 100644 +--- a/utils/pdfdetach.cc ++++ b/utils/pdfdetach.cc +@@ -163,6 +163,8 @@ int main(int argc, char *argv[]) { + nPages = doc->getCatalog()->getNumPages(); + for (i = 0; i < nPages; ++i) { + page = doc->getCatalog()->getPage(i + 1); ++ if (!page) ++ continue; + annots = page->getAnnots(); + if (!annots) + break; +-- +2.1.0 + diff --git a/SOURCES/poppler-0.26.2-pdfdoc-getpage.patch b/SOURCES/poppler-0.26.2-pdfdoc-getpage.patch new file mode 100644 index 0000000..880079d --- /dev/null +++ b/SOURCES/poppler-0.26.2-pdfdoc-getpage.patch @@ -0,0 +1,21 @@ +commit ee4a389872d86b619c677888da8f13f1f6c54472 +Author: Adrian Johnson +Date: Mon Oct 20 22:32:30 2014 +1030 + + PDFDoc: fix crash when getPage() returns NULL + + Bug 85235 + +diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc +index d1b5d7b..8fd5e18 100644 +--- a/poppler/PDFDoc.cc ++++ b/poppler/PDFDoc.cc +@@ -626,7 +626,7 @@ int PDFDoc::savePageAs(GooString *name, int pageNo) + int keyLength; + xref->getEncryptionParameters(&fileKey, &encAlgorithm, &keyLength); + +- if (pageNo < 1 || pageNo > getNumPages()) { ++ if (pageNo < 1 || pageNo > getNumPages() || !getCatalog()->getPage(pageNo)) { + error(errInternal, -1, "Illegal pageNo: {0:d}({1:d})", pageNo, getNumPages() ); + return errOpenFile; + } diff --git a/SOURCES/poppler-0.26.2-xref-getentry.patch b/SOURCES/poppler-0.26.2-xref-getentry.patch new file mode 100644 index 0000000..1c8d80b --- /dev/null +++ b/SOURCES/poppler-0.26.2-xref-getentry.patch @@ -0,0 +1,30 @@ +commit d6ea8acbb348fdb43601a963ba5407e933565003 +Author: Adrian Johnson +Date: Mon Nov 3 19:11:25 2014 +0100 + + fix crash in Xref::getEntry + + Bug 85234 + +diff --git a/poppler/XRef.cc b/poppler/XRef.cc +index 2560e3d..333f5ec 100644 +--- a/poppler/XRef.cc ++++ b/poppler/XRef.cc +@@ -1568,7 +1568,7 @@ GBool XRef::parseEntry(Goffset offset, XRefEntry *entry) + void XRef::readXRefUntil(int untilEntryNum, std::vector *xrefStreamObjsNum) + { + std::vector followedPrev; +- while (prevXRefOffset && (untilEntryNum == -1 || entries[untilEntryNum].type == xrefEntryNone)) { ++ while (prevXRefOffset && (untilEntryNum == -1 || (untilEntryNum < size && entries[untilEntryNum].type == xrefEntryNone))) { + bool followed = false; + for (size_t j = 0; j < followedPrev.size(); j++) { + if (followedPrev.at(j) == prevXRefOffset) { +@@ -1606,7 +1606,7 @@ void XRef::readXRefUntil(int untilEntryNum, std::vector *xrefStreamObjsNum) + + XRefEntry *XRef::getEntry(int i, GBool complainIfMissing) + { +- if (entries[i].type == xrefEntryNone) { ++ if (i >= size || entries[i].type == xrefEntryNone) { + + if ((!xRefStream) && mainXRefEntriesOffset) { + if (!parseEntry(mainXRefEntriesOffset + 20*i, &entries[i])) { diff --git a/SOURCES/poppler-0.26.5-JPXStream-length.patch b/SOURCES/poppler-0.26.5-JPXStream-length.patch new file mode 100644 index 0000000..9d7e303 --- /dev/null +++ b/SOURCES/poppler-0.26.5-JPXStream-length.patch @@ -0,0 +1,26 @@ +From 68ef84e5968a4249c2162b839ca6d7975048a557 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Mon, 15 Jul 2019 23:24:22 +0200 +Subject: [PATCH] JPXStream::init: ignore dict Length if clearly broken + +Fixes issue #805 +--- + poppler/JPEG2000Stream.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc +index 0eea3a2d..8e6902f4 100644 +--- a/poppler/JPEG2000Stream.cc ++++ b/poppler/JPEG2000Stream.cc +@@ -219,7 +219,7 @@ void JPXStream::init() + if (getDict()) getDict()->lookup("Length", &oLen); + + int bufSize = BUFFER_INITIAL_SIZE; +- if (oLen.isInt()) bufSize = oLen.getInt(); ++ if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt(); + oLen.free(); + + +-- +2.21.0 + diff --git a/SOURCES/poppler-0.26.5-PSOutputDev-rgb.patch b/SOURCES/poppler-0.26.5-PSOutputDev-rgb.patch new file mode 100644 index 0000000..e488900 --- /dev/null +++ b/SOURCES/poppler-0.26.5-PSOutputDev-rgb.patch @@ -0,0 +1,372 @@ +From 64aa150a92ccb082db6a3383fa734a6ac91cf1bf Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Tue, 30 Apr 2019 18:47:44 +0200 +Subject: [PATCH] PSOutputDev: Don't read outside of image buffer + +Check whether input image is RGB or BGR to not treat +it as CMYK in those cases in PSOutputDev::checkPageSlice(). + +Fixes #751 +--- + poppler/PSOutputDev.cc | 248 ++++++++++++++++++++++++++++++++--------- + 1 file changed, 196 insertions(+), 52 deletions(-) + +diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc +index 0d201835..155a8cbe 100644 +--- a/poppler/PSOutputDev.cc ++++ b/poppler/PSOutputDev.cc +@@ -3342,13 +3342,21 @@ GBool PSOutputDev::checkPageSlice(Page * + } + break; + case psLevel1Sep: ++ GfxColor inputColor; ++ GfxCMYK cmyk; ++ unsigned char cmykColor[4]; ++ GfxDeviceRGBColorSpace *rgbCS; ++ SplashColorMode colorMode; ++ ++ colorMode = bitmap->getMode(); ++ + useBinary = globalParams->getPSBinary(); + p = bitmap->getDataPtr(); + // Check for an all gray image + isGray = gTrue; + for (y = 0; y < h; ++y) { + for (x = 0; x < w; ++x) { +- if (p[4*x] != p[4*x + 1] || p[4*x] != p[4*x + 2]) { ++ if (p[numComps*x] != p[numComps*x + 1] || p[numComps*x] != p[numComps*x + 2]) { + isGray = gFalse; + y = h; + break; +@@ -3365,7 +3373,9 @@ GBool PSOutputDev::checkPageSlice(Page * + col[0] = col[1] = col[2] = col[3] = 0; + if (isGray) { + int g; +- if ((psProcessBlack & processColors) == 0) { ++ if ((psProcessBlack & processColors) == 0 && ++ colorMode != splashModeRGB8 && ++ colorMode != splashModeBGR8) { + // Check if the image uses black + for (y = 0; y < h; ++y) { + for (x = 0; x < w; ++x) { +@@ -3379,59 +3389,23 @@ GBool PSOutputDev::checkPageSlice(Page * + } + p = bitmap->getDataPtr() + (h - 1) * bitmap->getRowSize(); + } +- for (y = 0; y < h; ++y) { +- if (useBinary) { +- // Binary gray image +- for (x = 0; x < w; ++x) { +- g = p[4*x] + p[4*x + 3]; +- g = 255 - g; +- if (g < 0) g = 0; +- hexBuf[i++] = (Guchar) g; +- if (i >= 64) { +- writePSBuf(hexBuf, i); +- i = 0; +- } +- } +- } else { +- // Hex gray image +- for (x = 0; x < w; ++x) { +- g = p[4*x] + p[4*x + 3]; +- g = 255 - g; +- if (g < 0) g = 0; +- digit = g / 16; +- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); +- digit = g % 16; +- hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); +- if (i >= 64) { +- hexBuf[i++] = '\n'; +- writePSBuf(hexBuf, i); +- i = 0; +- } +- } +- } +- p -= bitmap->getRowSize(); +- } +- } else if (((psProcessCyan | psProcessMagenta | psProcessYellow | psProcessBlack) & ~processColors) != 0) { +- // Color image, need to check color flags for each dot +- for (y = 0; y < h; ++y) { +- for (comp = 0; comp < 4; ++comp) { ++ if (colorMode == splashModeRGB8 || colorMode != splashModeBGR8) { ++ for (y = 0; y < h; ++y) { + if (useBinary) { +- // Binary color image ++ // Binary gray image + for (x = 0; x < w; ++x) { +- col[comp] |= p[4*x + comp]; +- hexBuf[i++] = p[4*x + comp]; ++ hexBuf[i++] = (Guchar) p[3*x]; + if (i >= 64) { + writePSBuf(hexBuf, i); + i = 0; + } + } + } else { +- // Gray color image ++ // Hex gray image + for (x = 0; x < w; ++x) { +- col[comp] |= p[4*x + comp]; +- digit = p[4*x + comp] / 16; ++ digit = p[3*x] / 16; + hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); +- digit = p[4*x + comp] % 16; ++ digit = p[3*x] % 16; + hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); + if (i >= 64) { + hexBuf[i++] = '\n'; +@@ -3439,29 +3413,31 @@ GBool PSOutputDev::checkPageSlice(Page * + i = 0; + } + } +- } ++ } + } +- p -= bitmap->getRowSize(); +- } +- } else { +- // Color image, do not need to check color flags +- for (y = 0; y < h; ++y) { +- for (comp = 0; comp < 4; ++comp) { ++ } else { ++ for (y = 0; y < h; ++y) { + if (useBinary) { +- // Binary color image ++ // Binary gray image + for (x = 0; x < w; ++x) { +- hexBuf[i++] = p[4*x + comp]; ++ g = p[4*x] + p[4*x + 3]; ++ g = 255 - g; ++ if (g < 0) g = 0; ++ hexBuf[i++] = (Guchar) g; + if (i >= 64) { + writePSBuf(hexBuf, i); + i = 0; + } + } + } else { +- // Hex color image ++ // Hex gray image + for (x = 0; x < w; ++x) { +- digit = p[4*x + comp] / 16; ++ g = p[4*x] + p[4*x + 3]; ++ g = 255 - g; ++ if (g < 0) g = 0; ++ digit = g / 16; + hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); +- digit = p[4*x + comp] % 16; ++ digit = g % 16; + hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); + if (i >= 64) { + hexBuf[i++] = '\n'; +@@ -3469,9 +3445,207 @@ GBool PSOutputDev::checkPageSlice(Page * + i = 0; + } + } +- } ++ } + } +- p -= bitmap->getRowSize(); ++ } ++ p -= bitmap->getRowSize(); ++ } else if (((psProcessCyan | psProcessMagenta | psProcessYellow | psProcessBlack) & ~processColors) != 0) { ++ // Color image, need to check color flags for each dot ++ switch (colorMode) { ++ case splashModeRGB8: ++ case splashModeBGR8: ++ rgbCS = new GfxDeviceRGBColorSpace(); ++ for (y = 0; y < h; ++y) { ++ for (comp = 0; comp < 4; ++comp) { ++ if (useBinary) { ++ // Binary color image ++ for (x = 0; x < w; ++x) { ++ if (likely(colorMode == splashModeRGB8)) { ++ inputColor.c[0] = byteToCol(p[3*x + 0]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 2]); ++ } else { ++ inputColor.c[0] = byteToCol(p[3*x + 2]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 0]); ++ } ++ rgbCS->getCMYK(&inputColor, &cmyk); ++ cmykColor[0] = colToByte(cmyk.c); ++ cmykColor[1] = colToByte(cmyk.m); ++ cmykColor[2] = colToByte(cmyk.y); ++ cmykColor[3] = colToByte(cmyk.k); ++ ++ col[comp] |= cmykColor[comp]; ++ hexBuf[i++] = cmykColor[comp]; ++ if (i >= 64) { ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } else { ++ // Gray color image ++ for (x = 0; x < w; ++x) { ++ if (likely(colorMode == splashModeRGB8)) { ++ inputColor.c[0] = byteToCol(p[3*x + 0]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 2]); ++ } else { ++ inputColor.c[0] = byteToCol(p[3*x + 2]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 0]); ++ } ++ rgbCS->getCMYK(&inputColor, &cmyk); ++ cmykColor[0] = colToByte(cmyk.c); ++ cmykColor[1] = colToByte(cmyk.m); ++ cmykColor[2] = colToByte(cmyk.y); ++ cmykColor[3] = colToByte(cmyk.k); ++ ++ col[comp] |= cmykColor[comp]; ++ digit = cmykColor[comp] / 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ digit = cmykColor[comp] % 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ if (i >= 64) { ++ hexBuf[i++] = '\n'; ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } ++ } ++ p -= bitmap->getRowSize(); ++ } ++ delete rgbCS; ++ break; ++ default: ++ for (y = 0; y < h; ++y) { ++ for (comp = 0; comp < 4; ++comp) { ++ if (useBinary) { ++ // Binary color image ++ for (x = 0; x < w; ++x) { ++ col[comp] |= p[4*x + comp]; ++ hexBuf[i++] = p[4*x + comp]; ++ if (i >= 64) { ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } else { ++ // Gray color image ++ for (x = 0; x < w; ++x) { ++ col[comp] |= p[4*x + comp]; ++ digit = p[4*x + comp] / 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ digit = p[4*x + comp] % 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ if (i >= 64) { ++ hexBuf[i++] = '\n'; ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } ++ } ++ p -= bitmap->getRowSize(); ++ } ++ break; ++ } ++ } else { ++ // Color image, do not need to check color flags ++ switch (colorMode) { ++ case splashModeRGB8: ++ case splashModeBGR8: ++ rgbCS = new GfxDeviceRGBColorSpace(); ++ for (y = 0; y < h; ++y) { ++ for (comp = 0; comp < 4; ++comp) { ++ if (useBinary) { ++ // Binary color image ++ for (x = 0; x < w; ++x) { ++ if (likely(colorMode == splashModeRGB8)) { ++ inputColor.c[0] = byteToCol(p[3*x + 0]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 2]); ++ } else { ++ inputColor.c[0] = byteToCol(p[3*x + 2]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 0]); ++ } ++ rgbCS->getCMYK(&inputColor, &cmyk); ++ cmykColor[0] = colToByte(cmyk.c); ++ cmykColor[1] = colToByte(cmyk.m); ++ cmykColor[2] = colToByte(cmyk.y); ++ cmykColor[3] = colToByte(cmyk.k); ++ ++ hexBuf[i++] = cmykColor[comp]; ++ if (i >= 64) { ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } else { ++ // Hex color image ++ for (x = 0; x < w; ++x) { ++ if (likely(colorMode == splashModeRGB8)) { ++ inputColor.c[0] = byteToCol(p[3*x + 0]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 2]); ++ } else { ++ inputColor.c[0] = byteToCol(p[3*x + 2]); ++ inputColor.c[1] = byteToCol(p[3*x + 1]); ++ inputColor.c[2] = byteToCol(p[3*x + 0]); ++ } ++ rgbCS->getCMYK(&inputColor, &cmyk); ++ cmykColor[0] = colToByte(cmyk.c); ++ cmykColor[1] = colToByte(cmyk.m); ++ cmykColor[2] = colToByte(cmyk.y); ++ cmykColor[3] = colToByte(cmyk.k); ++ ++ digit = cmykColor[comp] / 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ digit = cmykColor[comp] % 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ if (i >= 64) { ++ hexBuf[i++] = '\n'; ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } ++ } ++ p -= bitmap->getRowSize(); ++ } ++ delete rgbCS; ++ break; ++ default: ++ for (y = 0; y < h; ++y) { ++ for (comp = 0; comp < 4; ++comp) { ++ if (useBinary) { ++ // Binary color image ++ for (x = 0; x < w; ++x) { ++ hexBuf[i++] = p[4*x + comp]; ++ if (i >= 64) { ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } else { ++ // Hex color image ++ for (x = 0; x < w; ++x) { ++ digit = p[4*x + comp] / 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ digit = p[4*x + comp] % 16; ++ hexBuf[i++] = digit + ((digit >= 10)? 'a' - 10: '0'); ++ if (i >= 64) { ++ hexBuf[i++] = '\n'; ++ writePSBuf(hexBuf, i); ++ i = 0; ++ } ++ } ++ } ++ } ++ p -= bitmap->getRowSize(); ++ } ++ break; + } + } + if (i != 0) { 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-annotink.patch b/SOURCES/poppler-0.26.5-annotink.patch new file mode 100644 index 0000000..d91c06f --- /dev/null +++ b/SOURCES/poppler-0.26.5-annotink.patch @@ -0,0 +1,34 @@ +From 942adfc25e7a00ac3cf032ced2d8949e99099f70 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Fri, 25 Sep 2015 00:30:58 +0200 +Subject: [PATCH] Fix crash on AnnotInk::draw for malformed documents + +--- + poppler/Annot.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/poppler/Annot.cc b/poppler/Annot.cc +index 85a8ac4a..29f3621f 100644 +--- a/poppler/Annot.cc ++++ b/poppler/Annot.cc +@@ -15,7 +15,7 @@ + // + // Copyright (C) 2006 Scott Turner + // Copyright (C) 2007, 2008 Julien Rebetez +-// Copyright (C) 2007-2013 Albert Astals Cid ++// Copyright (C) 2007-2013, 2015 Albert Astals Cid + // Copyright (C) 2007-2013 Carlos Garcia Campos + // Copyright (C) 2007, 2008 Iñigo Martínez + // Copyright (C) 2007 Jeff Muizelaar +@@ -6151,7 +6151,7 @@ void AnnotInk::draw(Gfx *gfx, GBool printing) { + + for (int i = 0; i < inkListLength; ++i) { + const AnnotPath * path = inkList[i]; +- if (path->getCoordsLength() != 0) { ++ if (path && path->getCoordsLength() != 0) { + appearBuf->appendf ("{0:.2f} {1:.2f} m\n", path->getX(0) - rect->x1, path->getY(0) - rect->y1); + appearBBox->extendTo (path->getX(0) - rect->x1, path->getY(0) - rect->y1); + +-- +2.17.0 + diff --git a/SOURCES/poppler-0.26.5-check-GfxSeparationColorSpace-existance.patch b/SOURCES/poppler-0.26.5-check-GfxSeparationColorSpace-existance.patch new file mode 100644 index 0000000..bf8e27e --- /dev/null +++ b/SOURCES/poppler-0.26.5-check-GfxSeparationColorSpace-existance.patch @@ -0,0 +1,38 @@ +From 9e9df4b20d17478996780008bc9802a857d173fc Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Thu, 8 Jan 2015 17:01:52 +0100 +Subject: Fix crash on broken document + +Bug #85281 + +diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc +index 359c0d6..b439942 100644 +--- a/poppler/GfxState.cc ++++ b/poppler/GfxState.cc +@@ -16,7 +16,7 @@ + // Copyright (C) 2005 Kristian Høgsberg + // Copyright (C) 2006, 2007 Jeff Muizelaar + // Copyright (C) 2006, 2010 Carlos Garcia Campos +-// Copyright (C) 2006-2014 Albert Astals Cid ++// Copyright (C) 2006-2015 Albert Astals Cid + // Copyright (C) 2009, 2012 Koji Otani + // Copyright (C) 2009, 2011-2013 Thomas Freitag + // Copyright (C) 2009 Christian Persch +@@ -3048,8 +3048,12 @@ GfxColorSpace *GfxDeviceNColorSpace::copy() { + int *mappingA = NULL; + + GooList *sepsCSA = new GooList(sepsCS->getLength()); +- for (i = 0; i < sepsCS->getLength(); i++) +- sepsCSA->append(((GfxSeparationColorSpace *) sepsCS->get(i))->copy()); ++ for (i = 0; i < sepsCS->getLength(); i++) { ++ GfxSeparationColorSpace *scs = (GfxSeparationColorSpace *) sepsCS->get(i); ++ if (scs != NULL) { ++ sepsCSA->append(scs->copy()); ++ } ++ } + if (mapping != NULL) { + mappingA = (int *)gmalloc(sizeof(int) * nComps); + for (i = 0; i < nComps; i++) +-- +cgit v0.10.2 + diff --git a/SOURCES/poppler-0.26.5-check-array-length.patch b/SOURCES/poppler-0.26.5-check-array-length.patch new file mode 100644 index 0000000..99b8cb5 --- /dev/null +++ b/SOURCES/poppler-0.26.5-check-array-length.patch @@ -0,0 +1,25 @@ +From b3425dd3261679958cd56c0f71995c15d2124433 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Tue, 22 Dec 2015 22:50:33 +0100 +Subject: Do not crash on invalid files + +Bug #93476 + +diff --git a/poppler/Function.cc b/poppler/Function.cc +index 67283df..ee5afc1 100644 +--- a/poppler/Function.cc ++++ b/poppler/Function.cc +@@ -577,6 +577,10 @@ ExponentialFunction::ExponentialFunction(Object *funcObj, Dict *dict) { + goto err2; + } + n = obj1.arrayGetLength(); ++ if (unlikely(n > funcMaxOutputs)) { ++ error(errSyntaxError, -1, "Function's C0 array is wrong length"); ++ n = funcMaxOutputs; ++ } + for (i = 0; i < n; ++i) { + obj1.arrayGet(i, &obj2); + if (!obj2.isNum()) { +-- +cgit v0.10.2 + diff --git a/SOURCES/poppler-0.26.5-check-for-int-overflow.patch b/SOURCES/poppler-0.26.5-check-for-int-overflow.patch new file mode 100644 index 0000000..1feba19 --- /dev/null +++ b/SOURCES/poppler-0.26.5-check-for-int-overflow.patch @@ -0,0 +1,33 @@ +From c114a90063d755639d2b0dbf816690a66b54bee0 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Sun, 8 Feb 2015 00:24:11 +0100 +Subject: Fix crash in fuzzed file from Bug #84988 + + +diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc +index c9db1e7..150d444 100644 +--- a/poppler/TextOutputDev.cc ++++ b/poppler/TextOutputDev.cc +@@ -20,7 +20,7 @@ + // Copyright (C) 2006 Jeff Muizelaar + // Copyright (C) 2007, 2008, 2012 Adrian Johnson + // Copyright (C) 2008 Koji Otani +-// Copyright (C) 2008, 2010-2012, 2014 Albert Astals Cid ++// Copyright (C) 2008, 2010-2012, 2014, 2015 Albert Astals Cid + // Copyright (C) 2008 Pino Toscano + // Copyright (C) 2008, 2010 Hib Eris + // Copyright (C) 2009 Ross Moore +@@ -622,6 +622,10 @@ void TextPool::addWord(TextWord *word) { + TextWord *w0, *w1; + + // expand the array if needed ++ if (unlikely((word->base / textPoolStep) > INT_MAX)) { ++ error(errSyntaxWarning, -1, "word->base / textPoolStep > INT_MAX"); ++ return; ++ } + wordBaseIdx = (int)(word->base / textPoolStep); + if (minBaseIdx > maxBaseIdx) { + minBaseIdx = wordBaseIdx - 128; +-- +cgit v0.10.2 + diff --git a/SOURCES/poppler-0.26.5-check-groupColorSpaceStack-existance.patch b/SOURCES/poppler-0.26.5-check-groupColorSpaceStack-existance.patch new file mode 100644 index 0000000..05cab1e --- /dev/null +++ b/SOURCES/poppler-0.26.5-check-groupColorSpaceStack-existance.patch @@ -0,0 +1,26 @@ +From 88eb9b4f57b488f0d7d79a8e115123484f4240c8 Mon Sep 17 00:00:00 2001 +From: Adrian Johnson +Date: Sun, 19 Oct 2014 21:36:39 +1030 +Subject: [PATCH] cairo: fix crash when no group color space + +Bug 85137 +--- + poppler/CairoOutputDev.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc +index 3babb63..03130ac 100644 +--- a/poppler/CairoOutputDev.cc ++++ b/poppler/CairoOutputDev.cc +@@ -1624,7 +1624,7 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, + cairo_t *maskCtx = cairo_create(source); + + //XXX: hopefully this uses the correct color space */ +- if (!alpha) { ++ if (!alpha && groupColorSpaceStack->cs) { + GfxRGB backdropColorRGB; + groupColorSpaceStack->cs->getRGB(backdropColor, &backdropColorRGB); + /* paint the backdrop */ +-- +2.1.1 + 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-do-not-assert-broken-document.patch b/SOURCES/poppler-0.26.5-do-not-assert-broken-document.patch new file mode 100644 index 0000000..1eff82e --- /dev/null +++ b/SOURCES/poppler-0.26.5-do-not-assert-broken-document.patch @@ -0,0 +1,36 @@ +From c909964bff671d5ff0d8eee5f613ded4562f8afd Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Sat, 7 Mar 2015 14:54:43 +0100 +Subject: Do not assert on broken document + +Bug #89422 + +diff --git a/poppler/SecurityHandler.cc b/poppler/SecurityHandler.cc +index d6f5599..44bd8b8 100644 +--- a/poppler/SecurityHandler.cc ++++ b/poppler/SecurityHandler.cc +@@ -288,12 +288,16 @@ StandardSecurityHandler::StandardSecurityHandler(PDFDoc *docA, + ok = gTrue; + } else if (encVersion == 5 && encRevision == 5) { + fileID = new GooString(); // unused for V=R=5 +- ownerEnc = ownerEncObj.getString()->copy(); +- userEnc = userEncObj.getString()->copy(); +- if (fileKeyLength > 32 || fileKeyLength < 0) { +- fileKeyLength = 32; ++ if (ownerEncObj.isString() && userEncObj.isString()) { ++ ownerEnc = ownerEncObj.getString()->copy(); ++ userEnc = userEncObj.getString()->copy(); ++ if (fileKeyLength > 32 || fileKeyLength < 0) { ++ fileKeyLength = 32; ++ } ++ ok = gTrue; ++ } else { ++ error(errSyntaxError, -1, "Weird encryption owner/user info"); + } +- ok = gTrue; + } else if (!(encVersion == -1 && encRevision == -1)) { + error(errUnimplemented, -1, + "Unsupported version/revision ({0:d}/{1:d}) of Standard security handler", +-- +cgit v0.10.2 + 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-find-correct-glyph.patch b/SOURCES/poppler-0.26.5-find-correct-glyph.patch new file mode 100644 index 0000000..450c6bb --- /dev/null +++ b/SOURCES/poppler-0.26.5-find-correct-glyph.patch @@ -0,0 +1,28 @@ +From 18016a2b647fa41d59a9926c59bc86ca859bba18 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Fri, 23 Oct 2015 10:15:47 +0200 +Subject: [PATCH] forms: Find correct glyph or return 0 + +Function CharCodeToUnicode::mapToCharCode() could return +wrong character code for given unicode character because +of wrongly placed continue statement. +--- + poppler/CharCodeToUnicode.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/poppler/CharCodeToUnicode.cc b/poppler/CharCodeToUnicode.cc +index 5576a4a..91f6ff2 100644 +--- a/poppler/CharCodeToUnicode.cc ++++ b/poppler/CharCodeToUnicode.cc +@@ -656,7 +656,7 @@ int CharCodeToUnicode::mapToCharCode(Unicode* u, CharCode *c, int usize) { + //compare the string char by char + for (j=0; j +Date: Sat, 18 Apr 2015 12:44:47 -0500 +Subject: [PATCH] glib: Fix segfault when creating PopplerAction + +Screen annotations and form fields currently pass a NULL pointer to +_poppler_action_new. Pass the PopplerDocument instead. + +Bug #90093 +--- + glib/poppler-annot.cc | 4 ++-- + glib/poppler-form-field.cc | 2 +- + glib/poppler-page.cc | 2 +- + glib/poppler-private.h | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc +index 15d48c5..312aa31 100644 +--- a/glib/poppler-annot.cc ++++ b/glib/poppler-annot.cc +@@ -559,7 +559,7 @@ poppler_annot_screen_class_init (PopplerAnnotScreenClass *klass) + } + + PopplerAnnot * +-_poppler_annot_screen_new (Annot *annot) ++_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot) + { + PopplerAnnot *poppler_annot; + AnnotScreen *annot_screen; +@@ -569,7 +569,7 @@ _poppler_annot_screen_new (Annot *annot) + annot_screen = static_cast(poppler_annot->annot); + action = annot_screen->getAction(); + if (action) +- POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (NULL, action, NULL); ++ POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (doc, action, NULL); + + return poppler_annot; + } +diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc +index 5687799..df184dd 100644 +--- a/glib/poppler-form-field.cc ++++ b/glib/poppler-form-field.cc +@@ -188,7 +188,7 @@ poppler_form_field_get_action (PopplerFormField *field) + if (!action) + return NULL; + +- field->action = _poppler_action_new (NULL, action, NULL); ++ field->action = _poppler_action_new (field->document, action, NULL); + + return field->action; + } +diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc +index db2387a..1025393 100644 +--- a/glib/poppler-page.cc ++++ b/glib/poppler-page.cc +@@ -1399,7 +1399,7 @@ poppler_page_get_annot_mapping (PopplerPage *page) + mapping->annot = _poppler_annot_movie_new (annot); + break; + case Annot::typeScreen: +- mapping->annot = _poppler_annot_screen_new (annot); ++ mapping->annot = _poppler_annot_screen_new (page->document, annot); + break; + case Annot::typeLine: + mapping->annot = _poppler_annot_line_new (annot); +diff --git a/glib/poppler-private.h b/glib/poppler-private.h +index 874cfdb..9abdd7c 100644 +--- a/glib/poppler-private.h ++++ b/glib/poppler-private.h +@@ -130,7 +130,7 @@ PopplerAnnot *_poppler_annot_free_text_new (Annot *annot); + PopplerAnnot *_poppler_annot_text_markup_new (Annot *annot); + PopplerAnnot *_poppler_annot_file_attachment_new (Annot *annot); + PopplerAnnot *_poppler_annot_movie_new (Annot *annot); +-PopplerAnnot *_poppler_annot_screen_new (Annot *annot); ++PopplerAnnot *_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot); + PopplerAnnot *_poppler_annot_line_new (Annot *annot); + PopplerAnnot *_poppler_annot_circle_new (Annot *annot); + PopplerAnnot *_poppler_annot_square_new (Annot *annot); +-- +2.1.4 + diff --git a/SOURCES/poppler-0.26.5-fix-splash.patch b/SOURCES/poppler-0.26.5-fix-splash.patch new file mode 100644 index 0000000..1888888 --- /dev/null +++ b/SOURCES/poppler-0.26.5-fix-splash.patch @@ -0,0 +1,81 @@ +From 92e41685dcef538a7fc669ca357ce9f448a8078e Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Sat, 7 Feb 2015 21:54:39 +0100 +Subject: Fix crash in malformed file from bug #85275 + + +diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc +index 97af5c4..6640ab5 100644 +--- a/poppler/SplashOutputDev.cc ++++ b/poppler/SplashOutputDev.cc +@@ -4048,8 +4048,8 @@ void SplashOutputDev::setSoftMask(GfxState *state, double *bbox, + p = softMask->getDataPtr() + ty * softMask->getRowSize() + tx; + int xMax = tBitmap->getWidth(); + int yMax = tBitmap->getHeight(); +- if (xMax + tx > bitmap->getWidth()) xMax = bitmap->getWidth() - tx; +- if (yMax + ty > bitmap->getHeight()) yMax = bitmap->getHeight() - ty; ++ if (xMax > bitmap->getWidth() - tx) xMax = bitmap->getWidth() - tx; ++ if (yMax > bitmap->getHeight() - ty) yMax = bitmap->getHeight() - ty; + for (y = 0; y < yMax; ++y) { + for (x = 0; x < xMax; ++x) { + if (alpha) { +diff --git a/splash/Splash.cc b/splash/Splash.cc +index fde272a..142516f 100644 +--- a/splash/Splash.cc ++++ b/splash/Splash.cc +@@ -11,7 +11,7 @@ + // All changes made under the Poppler project to this file are licensed + // under GPL version 2 or later + // +-// Copyright (C) 2005-2014 Albert Astals Cid ++// Copyright (C) 2005-2015 Albert Astals Cid + // Copyright (C) 2005 Marco Pesenti Gritti + // Copyright (C) 2010-2014 Thomas Freitag + // Copyright (C) 2010 Christian Feuersänger +@@ -5214,6 +5214,10 @@ SplashError Splash::composite(SplashBitmap *src, int xSrc, int ySrc, + return splashErrModeMismatch; + } + ++ if (unlikely(!bitmap->data)) { ++ return splashErrZeroImage; ++ } ++ + if(src->getSeparationList()->getLength() > bitmap->getSeparationList()->getLength()) { + for (x = bitmap->getSeparationList()->getLength(); x < src->getSeparationList()->getLength(); x++) + bitmap->getSeparationList()->append(((GfxSeparationColorSpace *)src->getSeparationList()->get(x))->copy()); +@@ -5783,6 +5787,10 @@ SplashError Splash::blitTransparent(SplashBitmap *src, int xSrc, int ySrc, + return splashErrModeMismatch; + } + ++ if (unlikely(!bitmap->data)) { ++ return splashErrZeroImage; ++ } ++ + switch (bitmap->mode) { + case splashModeMono1: + for (y = 0; y < h; ++y) { +diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc +index ac344f1..e886683 100644 +--- a/splash/SplashBitmap.cc ++++ b/splash/SplashBitmap.cc +@@ -11,7 +11,7 @@ + // All changes made under the Poppler project to this file are licensed + // under GPL version 2 or later + // +-// Copyright (C) 2006, 2009, 2010, 2012 Albert Astals Cid ++// Copyright (C) 2006, 2009, 2010, 2012, 2015 Albert Astals Cid + // Copyright (C) 2007 Ilmari Heikkinen + // Copyright (C) 2009 Shen Liang + // Copyright (C) 2009 Stefan Thomas +@@ -275,7 +275,7 @@ SplashError SplashBitmap::writeAlphaPGMFile(char *fileName) { + void SplashBitmap::getPixel(int x, int y, SplashColorPtr pixel) { + SplashColorPtr p; + +- if (y < 0 || y >= height || x < 0 || x >= width) { ++ if (y < 0 || y >= height || x < 0 || x >= width || !data) { + return; + } + switch (mode) { +-- +cgit v0.10.2 + 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-infinite-recursion.patch b/SOURCES/poppler-0.26.5-infinite-recursion.patch new file mode 100644 index 0000000..35b8110 --- /dev/null +++ b/SOURCES/poppler-0.26.5-infinite-recursion.patch @@ -0,0 +1,52 @@ +From 60b4fe65bc9dc9b82bbadf0be2e3781be796a13d Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Tue, 1 May 2018 02:46:17 +0200 +Subject: FoFiType1C::cvtGlyph: Fix infinite recursion on malformed documents + +Bugs #104942, #103238 +--- + fofi/FoFiType1C.cc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc +index 03e7799..b14561f 100644 +--- a/fofi/FoFiType1C.cc ++++ b/fofi/FoFiType1C.cc +@@ -13,7 +13,7 @@ + // All changes made under the Poppler project to this file are licensed + // under GPL version 2 or later + // +-// Copyright (C) 2009, 2010 Albert Astals Cid ++// Copyright (C) 2009, 2010, 2017, 2018 Albert Astals Cid + // Copyright (C) 2012 Thomas Freitag + // + // To see a description of the changes please see the Changelog file that +@@ -32,6 +32,7 @@ + #include + #include "goo/gmem.h" + #include "goo/gstrtod.h" ++#include "goo/GooLikely.h" + #include "goo/GooString.h" + #include "FoFiEncodings.h" + #include "FoFiType1C.h" +@@ -1361,7 +1362,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf, + --nOps; + ok = gTrue; + getIndexVal(subrIdx, k, &val, &ok); +- if (ok) { ++ if (likely(ok && val.pos != offset)) { + cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse); + } + } else { +@@ -1596,7 +1597,7 @@ void FoFiType1C::cvtGlyph(int offset, int nBytes, GooString *charBuf, + --nOps; + ok = gTrue; + getIndexVal(&gsubrIdx, k, &val, &ok); +- if (ok) { ++ if (likely(ok && val.pos != offset)) { + cvtGlyph(val.pos, val.len, charBuf, subrIdx, pDict, gFalse); + } + } else { +-- +cgit v1.1 + diff --git a/SOURCES/poppler-0.26.5-jpeg2000-component-size.patch b/SOURCES/poppler-0.26.5-jpeg2000-component-size.patch new file mode 100644 index 0000000..20562da --- /dev/null +++ b/SOURCES/poppler-0.26.5-jpeg2000-component-size.patch @@ -0,0 +1,41 @@ +From 89a5367d49b2556a2635dbb6d48d6a6b182a2c6c Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Thu, 23 May 2019 00:54:29 +0200 +Subject: [PATCH] JPEG2000Stream: fail gracefully if not all components have + the same WxH + +I think this is just a mistake, or at least the only file we have with +this scenario is a fuzzed one +--- + poppler/JPEG2000Stream.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc +index 15bbcae4..0eea3a2d 100644 +--- a/poppler/JPEG2000Stream.cc ++++ b/poppler/JPEG2000Stream.cc +@@ -4,7 +4,7 @@ + // + // A JPX stream decoder using OpenJPEG + // +-// Copyright 2008-2010, 2012 Albert Astals Cid ++// Copyright 2008-2010, 2012, 2019 Albert Astals Cid + // Copyright 2011 Daniel Glöckner + // Copyright 2013 Adrian Johnson + // +@@ -253,6 +253,12 @@ void JPXStream::init() + close(); + break; + } ++ const int componentPixels = image->comps[component].w * image->comps[component].h; ++ if (componentPixels != npixels) { ++ error(errSyntaxWarning, -1, "Component {0:d} has different WxH than component 0", component); ++ close(); ++ break; ++ } + unsigned char *cdata = (unsigned char *)image->comps[component].data; + int adjust = 0; + if (image->comps[component].prec > 8) +-- +2.21.0 + diff --git a/SOURCES/poppler-0.26.5-move-array-reallocation.patch b/SOURCES/poppler-0.26.5-move-array-reallocation.patch new file mode 100644 index 0000000..7771e4a --- /dev/null +++ b/SOURCES/poppler-0.26.5-move-array-reallocation.patch @@ -0,0 +1,44 @@ +From e2a8d2c149988a96fec0dc0ec38001091cd9061e Mon Sep 17 00:00:00 2001 +From: Jason Crain +Date: Fri, 19 Dec 2014 01:56:45 -0600 +Subject: [PATCH] Move array reallocation from visitLine to startLine + +Fixes potential memory corruption from writing after end of lines +array. + +https://bugs.freedesktop.org/show_bug.cgi?id=84555 +--- + poppler/TextOutputDev.cc | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc +index 4b7ff40..9ed955e 100644 +--- a/poppler/TextOutputDev.cc ++++ b/poppler/TextOutputDev.cc +@@ -4072,6 +4072,11 @@ void TextSelectionDumper::startLine() + + void TextSelectionDumper::finishLine() + { ++ if (nLines == linesSize) { ++ linesSize *= 2; ++ lines = (GooList **)grealloc(lines, linesSize * sizeof(GooList *)); ++ } ++ + if (words && words->getLength() > 0) + lines[nLines++] = words; + else if (words) +@@ -4088,11 +4093,6 @@ void TextSelectionDumper::visitLine (TextLine *line, + { + TextLineFrag frag; + +- if (nLines == linesSize) { +- linesSize *= 2; +- lines = (GooList **)grealloc(lines, linesSize * sizeof(GooList *)); +- } +- + frag.init(line, edge_begin, edge_end - edge_begin); + + if (tableId >= 0 && frag.line->blk->tableId < 0) { +-- +2.1.3 + diff --git a/SOURCES/poppler-0.26.5-negative-object-number.patch b/SOURCES/poppler-0.26.5-negative-object-number.patch new file mode 100644 index 0000000..9cf8200 --- /dev/null +++ b/SOURCES/poppler-0.26.5-negative-object-number.patch @@ -0,0 +1,31 @@ +From 004e3c10df0abda214f0c293f9e269fdd979c5ee Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Wed, 18 Jul 2018 20:31:27 +0200 +Subject: Fix crash when Object has negative number + +Spec says object number has to be > 0 and gen has to be >= 0 + +Reported by email + +Modified by Marek Kasik for older release + +diff --git a/poppler/Parser.cc b/poppler/Parser.cc +index 39c9a967..8b0093e3 100644 +--- a/poppler/Parser.cc ++++ b/poppler/Parser.cc +@@ -154,9 +154,14 @@ Object Parser::getObj(GBool simpleOnly, + num = buf1.getInt(); + shift(); + if (buf1.isInt() && buf2.isCmd("R")) { ++ const int gen = buf1.getInt(); +- obj->initRef(num, buf1.getInt()); ++ obj->initRef(num, gen); + shift(); + shift(); ++ ++ if (unlikely(num <= 0 || gen < 0)) { ++ obj->free(); ++ } + } else { + obj->initInt(num); + } 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-pdfseparate.patch b/SOURCES/poppler-0.26.5-pdfseparate.patch new file mode 100644 index 0000000..dc26cda --- /dev/null +++ b/SOURCES/poppler-0.26.5-pdfseparate.patch @@ -0,0 +1,11 @@ +--- poppler-0.26.5/utils/pdfseparate.cc ++++ poppler-0.26.5/utils/pdfseparate.cc +@@ -95,7 +95,7 @@ bool extractPages (const char *srcFileNa + } + } + if (!foundmatch && firstPage != lastPage) { +- error(errSyntaxError, -1, "'{0:s}' must contain '%%d' if more than one page should be extracted", destFileName); ++ error(errSyntaxError, -1, "'{0:s}' must contain '%d' if more than one page should be extracted", destFileName); + free(auxDestFileName); + return false; + } 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-pfb-headers.patch b/SOURCES/poppler-0.26.5-pfb-headers.patch new file mode 100644 index 0000000..706e460 --- /dev/null +++ b/SOURCES/poppler-0.26.5-pfb-headers.patch @@ -0,0 +1,88 @@ +--- poppler-0.26.5/poppler/PSOutputDev.cc ++++ poppler-0.26.5/poppler/PSOutputDev.cc +@@ -2069,7 +2069,7 @@ void PSOutputDev::setupEmbeddedType1Font + static const char hexChar[17] = "0123456789abcdef"; + Object refObj, strObj, obj1, obj2, obj3; + Dict *dict; +- int length1, length2, length3; ++ long length1, length2, length3; + int c; + int start[4]; + GBool binMode; +@@ -2119,8 +2119,18 @@ void PSOutputDev::setupEmbeddedType1Font + embFontList->append(psName->getCString()); + embFontList->append("\n"); + +- // copy ASCII portion of font + strObj.streamReset(); ++ if (strObj.streamGetChar() == 0x80 && ++ strObj.streamGetChar() == 1) { ++ // PFB format ++ length1 = strObj.streamGetChar() | ++ (strObj.streamGetChar() << 8) | ++ (strObj.streamGetChar() << 16) | ++ (strObj.streamGetChar() << 24); ++ } else { ++ strObj.streamReset(); ++ } ++ // copy ASCII portion of font + for (i = 0; i < length1 && (c = strObj.streamGetChar()) != EOF; ++i) { + writePSChar(c); + } +@@ -2153,9 +2163,18 @@ void PSOutputDev::setupEmbeddedType1Font + + // convert binary data to ASCII + if (binMode) { +- for (i = 0; i < 4; ++i) { +- writePSChar(hexChar[(start[i] >> 4) & 0x0f]); +- writePSChar(hexChar[start[i] & 0x0f]); ++ if (start[0] == 0x80 && ++ start[1] == 2) { ++ length2 = start[2] | ++ (start[3] << 8) | ++ (strObj.streamGetChar() << 16) | ++ (strObj.streamGetChar() << 24); ++ i = 0; ++ } else { ++ for (i = 0; i < 4; ++i) { ++ writePSChar(hexChar[(start[i] >> 4) & 0x0f]); ++ writePSChar(hexChar[start[i] & 0x0f]); ++ } + } + #if 0 // this causes trouble for various PostScript printers + // if Length2 is incorrect (too small), font data gets chopped, so +@@ -2193,8 +2212,32 @@ void PSOutputDev::setupEmbeddedType1Font + { + if (length3 > 0) { + // write fixed-content portion +- while ((c = strObj.streamGetChar()) != EOF) { +- writePSChar(c); ++ c = strObj.streamGetChar(); ++ if (c == 0x80) { ++ c = strObj.streamGetChar(); ++ if (c == 1) { ++ length3 = strObj.streamGetChar() | ++ (strObj.streamGetChar() << 8) | ++ (strObj.streamGetChar() << 16) | ++ (strObj.streamGetChar() << 24); ++ ++ i = 0; ++ while (i < length3) { ++ if ((c = strObj.streamGetChar()) == EOF) { ++ break; ++ } ++ writePSChar(c); ++ ++i; ++ } ++ } ++ } else { ++ if (c != EOF) { ++ writePSChar(c); ++ ++ while ((c = strObj.streamGetChar()) != EOF) { ++ writePSChar(c); ++ } ++ } + } + } else { + // write padding and "cleartomark" 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-show-some-non-ASCII-characters.patch b/SOURCES/poppler-0.26.5-show-some-non-ASCII-characters.patch new file mode 100644 index 0000000..9d2b07a --- /dev/null +++ b/SOURCES/poppler-0.26.5-show-some-non-ASCII-characters.patch @@ -0,0 +1,28 @@ +From 22c8eb7e746827c694693895fc709a4ba7fdb957 Mon Sep 17 00:00:00 2001 +From: Marek Kasik +Date: Thu, 22 Oct 2015 16:15:23 +0200 +Subject: [PATCH] forms: Fix showing of some non-ASCII characters + +The &uChar is an array with just 1 member not 2. +This fixes mapping of some Unicode characters to +character codes. +--- + poppler/Annot.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/poppler/Annot.cc b/poppler/Annot.cc +index f3f479c..89bbc89 100644 +--- a/poppler/Annot.cc ++++ b/poppler/Annot.cc +@@ -4125,7 +4125,7 @@ void Annot::layoutText(GooString *text, GooString *outBuf, int *i, + // This assumes an identity CMap. + outBuf->append((uChar >> 8) & 0xff); + outBuf->append(uChar & 0xff); +- } else if (ccToUnicode->mapToCharCode(&uChar, &c, 2)) { ++ } else if (ccToUnicode->mapToCharCode(&uChar, &c, 1)) { + ccToUnicode->decRefCnt(); + if (font->isCIDFont()) { + // TODO: This assumes an identity CMap. It should be extended to +-- +2.4.3 + diff --git a/SOURCES/poppler-0.26.5-soname-bump.patch b/SOURCES/poppler-0.26.5-soname-bump.patch new file mode 100644 index 0000000..bc0465a --- /dev/null +++ b/SOURCES/poppler-0.26.5-soname-bump.patch @@ -0,0 +1,41 @@ +--- poppler-0.26.5/cpp/Makefile.am ++++ poppler-0.26.5/cpp/Makefile.am +@@ -67,4 +67,4 @@ libpoppler_cpp_la_LIBADD = \ + $(top_builddir)/poppler/libpoppler.la \ + $(LIBICONV) + +-libpoppler_cpp_la_LDFLAGS = -version-info 2:0:2 @create_shared_lib@ @auto_import_flags@ ++libpoppler_cpp_la_LDFLAGS = -version-info 12:0:2 @create_shared_lib@ @auto_import_flags@ +--- poppler-0.26.5/glib/Makefile.am ++++ poppler-0.26.5/glib/Makefile.am +@@ -78,7 +78,7 @@ libpoppler_glib_la_LIBADD = \ + $(POPPLER_GLIB_LIBS) \ + $(FREETYPE_LIBS) + +-libpoppler_glib_la_LDFLAGS = -version-info 14:0:6 @create_shared_lib@ @auto_import_flags@ ++libpoppler_glib_la_LDFLAGS = -version-info 24:0:6 @create_shared_lib@ @auto_import_flags@ + + BUILT_SOURCES = \ + poppler-enums.c \ +--- poppler-0.26.5/glib/Poppler-0.18.gir ++++ poppler-0.26.5/glib/Poppler-0.18.gir +@@ -13,7 +13,7 @@ and/or use gtk-doc annotations. --> + + + +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 new file mode 100644 index 0000000..5027042 --- /dev/null +++ b/SPECS/poppler.spec @@ -0,0 +1,1119 @@ +Summary: PDF rendering library +Name: poppler +Version: 0.26.5 +Release: 41%{?dist} +License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT +Group: Development/Libraries +URL: http://poppler.freedesktop.org/ +Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz + +# https://bugzilla.redhat.com/show_bug.cgi?id=1164389 +Patch0: poppler-0.26.2-pdfdetach.patch + +Patch1: poppler-0.26.2-fofitype1.patch +Patch2: poppler-0.26.2-pdfdoc-getpage.patch +Patch3: poppler-0.26.2-xref-getentry.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1167020 +Patch4: poppler-0.26.2-invalid-matrix.patch + +Patch5: poppler-0.26.5-pdfseparate.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1053616 +Patch6: poppler-0.22.5-rotated-words-selection.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1174537 +Patch7: poppler-0.26.5-soname-bump.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1241488 +Patch8: poppler-0.26.5-pfb-headers.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299503 +Patch9: poppler-0.26.5-fix-creating-poppleraction.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299500 +Patch10: poppler-0.26.5-do-not-assert-broken-document.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299496 +Patch11: poppler-0.26.5-check-for-int-overflow.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299490 +Patch12: poppler-0.26.5-check-GfxSeparationColorSpace-existance.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299481 +Patch13: poppler-0.26.5-move-array-reallocation.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299479 +Patch14: poppler-0.26.5-check-groupColorSpaceStack-existance.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1298616 +Patch15: poppler-0.26.5-show-some-non-ASCII-characters.patch +Patch16: poppler-0.26.5-find-correct-glyph.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299506 +Patch17: poppler-0.26.5-check-array-length.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1299492 +Patch18: poppler-0.26.5-fix-splash.patch + +Patch19: CVE-2017-9776.patch +Patch20: CVE-2017-9775-1.patch +Patch21: CVE-2017-9775-2.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1588610 +Patch22: poppler-0.26.5-annotink.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1579180 +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 + +# https://bugzilla.redhat.com/show_bug.cgi?id=1696636 +Patch42: poppler-0.26.5-PSOutputDev-rgb.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1713582 +Patch43: poppler-0.26.5-jpeg2000-component-size.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1732340 +Patch44: poppler-0.26.5-JPXStream-length.patch + +Requires: poppler-data >= 0.4.0 +BuildRequires: automake libtool +BuildRequires: gettext-devel +BuildRequires: libjpeg-devel +BuildRequires: openjpeg-devel >= 1.3-5 +BuildRequires: pkgconfig(cairo) >= 1.10.0 +BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(QtGui) pkgconfig(QtXml) +BuildRequires: pkgconfig(libtiff-4) + + +%description +Poppler, a PDF rendering library, is a fork of the xpdf PDF +viewer developed by Derek Noonburg of Glyph and Cog, LLC. + +%package devel +Summary: Libraries and headers for poppler +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +You should install the poppler-devel package if you would like to +compile applications based on poppler. + +%package glib +Summary: Glib wrapper for poppler +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description glib +%{summary}. + +%package glib-devel +Summary: Development files for glib wrapper +Group: Development/Libraries +Requires: %{name}-glib%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description glib-devel +%{summary}. + + +%package qt +Summary: Qt4 wrapper for poppler +Group: System Environment/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} +%{?_qt4:Requires: qt4%{?_isa} >= %{_qt4_version}} +Obsoletes: poppler-qt4 < 0.16.0-3 +Provides: poppler-qt4 = %{version}-%{release} +%description qt +%{summary}. + +%package qt-devel +Summary: Development files for Qt4 wrapper +Group: Development/Libraries +Requires: %{name}-qt%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Obsoletes: poppler-qt4-devel < 0.16.0-3 +Provides: poppler-qt4-devel = %{version}-%{release} +Requires: qt4-devel +%description qt-devel +%{summary}. + + +%package cpp +Summary: Pure C++ wrapper for poppler +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description cpp +%{summary}. + +%package cpp-devel +Summary: Development files for C++ wrapper +Group: Development/Libraries +Requires: %{name}-cpp%{?_isa} = %{version}-%{release} +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description cpp-devel +%{summary}. + +%package utils +Summary: Command line utilities for converting PDF files +Group: Applications/Text +Requires: %{name}%{?_isa} = %{version}-%{release} +%if 0%{?fedora} < 11 && 0%{?rhel} < 6 +# last seen in fc8 +Provides: pdftohtml = 0.36-11 +Obsoletes: pdftohtml < 0.36-11 +# last seen in fc7 +Provides: xpdf-utils = 1:3.01-27 +Obsoletes: xpdf-utils < 1:3.01-27 +# even earlier? +Conflicts: xpdf <= 1:3.01-8 +%endif +%description utils +Poppler, a PDF rendering library, is a fork of the xpdf PDF +viewer developed by Derek Noonburg of Glyph and Cog, LLC. + +This utils package installs a number of command line tools for +converting PDF files to a number of other formats. + +%package demos +Summary: Demos for poppler +Group: Applications/Text +Requires: %{name}-glib%{?_isa} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description demos +%{summary}. + +%prep +%setup -q +%patch0 -p1 -b .pdfdetach +%patch1 -p1 -b .fofitype1 +%patch2 -p1 -b .pdfdoc-getpage +%patch3 -p1 -b .xref-getentry +%patch4 -p1 -b .invalid-matrix +%patch5 -p1 -b .pdfseparate +%patch6 -p1 -b .rotated-word-selection +%patch7 -p1 -b .soname-bump +%patch8 -p1 -b .pfb-headers +%patch9 -p1 -b .fix-creating-poppleraction +%patch10 -p1 -b .do-not-assert-broken-document +%patch11 -p1 -b .check-for-int-overflow +%patch12 -p1 -b .check-GfxSeparationColorSpace-existance +%patch13 -p1 -b .move-array-reallocation +%patch14 -p1 -b .check-groupColorSpaceStack-existance +%patch15 -p1 -b .show-some-non-ASCII-characters +%patch16 -p1 -b .find-correct-glyph +%patch17 -p1 -b .check-array-length +%patch18 -p1 -b .fix-splash +%patch19 -p1 -b .CVE-2017-9776 +%patch20 -p1 -b .CVE-2017-9775-1 +%patch21 -p1 -b .CVE-2017-9775-1 +%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 +%patch42 -p1 -b .psoutputdev-rgb +%patch43 -p1 -b .jpeg2000-component-size +%patch44 -p1 -b .jpxstream-length + +# hammer to nuke rpaths, recheck on new releases +autoreconf -i -f + + +%build + +# Hack around borkage, http://cgit.freedesktop.org/poppler/poppler/commit/configure.ac?id=9250449aaa279840d789b3a7cef75d06a0fd88e7 +PATH=%{_qt4_bindir}:$PATH; export PATH + +%configure \ + --disable-silent-rules \ + --disable-static \ + --enable-cairo-output \ + --enable-libjpeg \ + --enable-libopenjpeg \ + --enable-poppler-qt4 \ + --disable-poppler-qt5 \ + --enable-xpdf-headers \ + --disable-zlib \ + --enable-introspection=yes + +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +rm -fv $RPM_BUILD_ROOT%{_libdir}/lib*.la + + +%check +# verify pkg-config sanity/version +export PKG_CONFIG_PATH=%{buildroot}%{_datadir}/pkgconfig:%{buildroot}%{_libdir}/pkgconfig +test "$(pkg-config --modversion poppler)" = "%{version}" +test "$(pkg-config --modversion poppler-cairo)" = "%{version}" +test "$(pkg-config --modversion poppler-cpp)" = "%{version}" +test "$(pkg-config --modversion poppler-glib)" = "%{version}" +test "$(pkg-config --modversion poppler-qt4)" = "%{version}" +test "$(pkg-config --modversion poppler-splash)" = "%{version}" + + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post glib -p /sbin/ldconfig + +%postun glib -p /sbin/ldconfig + +%post qt -p /sbin/ldconfig + +%postun qt -p /sbin/ldconfig + +%post cpp -p /sbin/ldconfig + +%postun cpp -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +%doc COPYING README +%{_libdir}/libpoppler.so.46* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/pkgconfig/poppler.pc +%{_libdir}/pkgconfig/poppler-splash.pc +%{_libdir}/libpoppler.so +%dir %{_includedir}/poppler/ +# xpdf headers +%{_includedir}/poppler/*.h +%{_includedir}/poppler/fofi/ +%{_includedir}/poppler/goo/ +%{_includedir}/poppler/splash/ +%{_datadir}/gtk-doc/ + +%files glib +%defattr(-,root,root,-) +%{_libdir}/libpoppler-glib.so.18* +%{_libdir}/girepository-1.0/Poppler-0.18.typelib + +%files glib-devel +%defattr(-,root,root,-) +%{_libdir}/pkgconfig/poppler-glib.pc +%{_libdir}/pkgconfig/poppler-cairo.pc +%{_libdir}/libpoppler-glib.so +%{_datadir}/gir-1.0/Poppler-0.18.gir +%{_includedir}/poppler/glib/ + +%files qt +%defattr(-,root,root,-) +%{_libdir}/libpoppler-qt4.so.14* + +%files qt-devel +%defattr(-,root,root,-) +%{_libdir}/libpoppler-qt4.so +%{_libdir}/pkgconfig/poppler-qt4.pc +%{_includedir}/poppler/qt4/ + +%files cpp +%defattr(-,root,root,-) +%{_libdir}/libpoppler-cpp.so.10* + +%files cpp-devel +%defattr(-,root,root,-) +%{_libdir}/pkgconfig/poppler-cpp.pc +%{_libdir}/libpoppler-cpp.so +%{_includedir}/poppler/cpp + +%files utils +%defattr(-,root,root,-) +%{_bindir}/pdf* +%{_mandir}/man1/* + +%files demos +%defattr(-,root,root,-) +%{_bindir}/poppler-glib-demo + + +%changelog +* Tue Aug 13 2019 Marek Kasik - 0.26.5-41 +- Ignore dict Length if it is broken +- Resolves: #1733026 + +* Tue Aug 13 2019 Marek Kasik - 0.26.5-40 +- Fail gracefully if not all components of JPEG2000Stream +- have the same size +- Resolves: #1723504 + +* Tue Aug 13 2019 Marek Kasik - 0.26.5-39 +- Check whether input is RGB in PSOutputDev::checkPageSlice() +- Resolves: #1697575 + +* 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 + +* Thu Jun 21 2018 Marek Kasik - 0.26.5-19 +- Fix infinite recursion on malformed documents (CVE-2017-18267) +- Resolves: #1579180 + +* Thu Jun 21 2018 Marek Kasik - 0.26.5-18 +- Fix crash inn AnnotInk::draw() (CVE-2018-10768) +- Resolves: #1588610 + +* Thu Aug 18 2016 Caolán McNamara - 0.26.5-17 +- Resolves:rhbz#1482935 CVE-2017-9776 + +* Wed Mar 9 2016 Martin Hatina - 0.26.5-16 +- Fix crash in Splash +- Resolves: #1299492 + +* Wed Mar 9 2016 Martin Hatina - 0.26.5-15 +- Check array length +- Resolves: #1299506 + +* Tue Mar 8 2016 Martin Hatina - 0.26.5-14 +- Show correct glyph or none instead of 'fi' +- Resolves: #1298616 + +* Tue Mar 8 2016 Martin Hatina - 0.26.5-13 +- Check for groupColorSpace existance +- Resolves: #1299479 + +* Tue Mar 8 2016 Martin Hatina - 0.26.5-12 +- Move array reallocation from visitLine to startLine +- Resolves: #1299481 + +* Mon Mar 7 2016 Martin Hatina - 0.26.5-11 +- Repair patch +- Resolves: #1299490 + +* Mon Mar 7 2016 Martin Hatina - 0.26.5-10 +- Check for GfxSeparationColorSpace existance +- Resolves: #1299490 + +* Mon Mar 7 2016 Martin Hatina - 0.26.5-9 +- Check for int overflow +- Resolves: #1299496 + +* Wed Mar 2 2016 Martin Hatina - 0.26.5-8 +- Do not assert on broken document +- Resolves: #1299500 + +* Tue Mar 1 2016 Martin Hatina - 0.26.5-7 +- Add missing patch +- Resolves: #1299503 + +* Tue Mar 1 2016 Martin Hatina - 0.26.5-6 +- Fix segfault when creating PopplerAction +- Resolves: #1299503 + +* Thu Jul 9 2015 Marek Kasik - 0.26.5-5 +- Remove PFB headers from embedded Type1 fonts +- before embedding them into a PostScript file. +- Resolves: #1241488 + +* Fri Apr 24 2015 Marek Kasik - 0.26.5-4 +- Bump sonames of all frontends so that they loads symbols +- from correct libpoppler.so.* when the compat-poppler022 +- package is installed. +- Resolves: #1174537 + +* Wed Apr 8 2015 Marek Kasik - 0.26.5-3 +- Add missing patch +- Resolves: #1174537 + +* Thu Mar 26 2015 Marek Kasik - 0.26.5-2 +- Initialize x1 and y1 in TextSelectionPainter::visitLine() +- Resolves: #1174537 + +* Wed Mar 25 2015 Marek Kasik - 0.26.5-1 +- Update to 0.26.5 +- Remove unused patches +- Rereview patches from fedora +- Modify RHEL patches so that they apply +- Disable Qt5 explicitly +- Resolves: #1174537 + +* Thu Mar 19 2015 Richard Hughes - 0.26.2-1 +- Update to 0.26.2 +- Resolves: #1174537 + +* Fri Feb 14 2014 Marek Kasik - 0.22.5-6 +- Add explicit requirement of poppler to poppler-demos (RPMDiff) +- Related: #1053616 + +* Fri Feb 14 2014 Marek Kasik - 0.22.5-5 +- Fix selection of words rotated by multiples of 90 degrees +- Resolves: #1053616 + +* Fri Jan 24 2014 Daniel Mach - 0.22.5-4 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.22.5-3 +- Mass rebuild 2013-12-27 + +* Thu Oct 31 2013 Marek Kasik 0.22.5-2 +- Add poppler-0.22.5-CVE-2013-4473.patch + (Limit length of output to pathName buffer) +- Add poppler-0.22.5-CVE-2013-4474.patch + (Check file pattern) +- Resolves: #1025160 + +* Mon Jun 24 2013 Marek Kasik 0.22.5-1 +- Update to 0.22.5 + +* Thu Jun 20 2013 Marek Kasik 0.22.1-5 +- Switch from LCMS to LCMS2 +- Resolves: #975465 + +* Wed Jun 5 2013 Marek Kasik 0.22.1-4 +- Fix changelog dates + +* Fri Apr 12 2013 Marek Kasik 0.22.1-3 +- Enable generating of TIFF files by pdftoppm + +* Thu Apr 11 2013 Marek Kasik 0.22.1-2 +- Fix man pages of pdftops and pdfseparate + +* Wed Feb 27 2013 Marek Kasik 0.22.1-1 +- Update to 0.22.1 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.22.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Jan 20 2013 Rex Dieter 0.22.0-2 +- -demos: omit extraneous (and broken) dep + +* Fri Jan 18 2013 Marek Kasik 0.22.0-1 +- Update to 0.22.0 + +* Tue Nov 13 2012 Marek Kasik 0.20.2-9 +- Move poppler-glib-demo to new sub-package demos +- Resolves: #872338 + +* Mon Nov 12 2012 Marek Kasik 0.20.2-8 +- Add references to corresponding bugs for poppler-0.20.3-5.patch + +* Tue Nov 6 2012 Marek Kasik 0.20.2-7 +- Add missing hunk to patch poppler-0.20.3-5.patch + +* Tue Nov 6 2012 Marek Kasik 0.20.2-6 +- Backport most of the changes from poppler-0.20.3 - poppler-0.20.5 +- (those which doesn't change API or ABI and are important) +- See poppler-0.20.3-5.patch for detailed list of included commits + +* Wed Oct 31 2012 Marek Kasik 0.20.2-5 +- Remove unused patch + +* Wed Oct 31 2012 Marek Kasik 0.20.2-4 +- Update License field + +* Mon Aug 6 2012 Marek Kasik 0.20.2-3 +- Fix conversion to ps when having multiple strips + +* Mon Aug 6 2012 Marek Kasik 0.20.2-2 +- Make sure xScale and yScale are always initialized +- Resolves: #840515 + +* Mon Aug 6 2012 Marek Kasik 0.20.2-1 +- Update to 0.20.2 + +* Mon Aug 6 2012 Marek Kasik 0.20.1-3 +- Try empty string instead of NULL as password if needed +- Resolves: #845578 + +* Sat Jul 21 2012 Fedora Release Engineering - 0.20.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 2 2012 Marek Kasik 0.20.1-1 +- Update to 0.20.1 + +* Mon Jun 25 2012 Nils Philippsen +- license is "GPLv2 or GPLv3" from poppler-0.20.0 on (based off xpdf-3.03) + +* Wed May 16 2012 Marek Kasik 0.20.0-1 +- Update to 0.20.0 + +* Fri May 4 2012 Marek Kasik 0.18.4-3 +- Backport of a patch which sets mask matrix before drawing an image with a mask +- Resolves: #817378 + +* Tue Feb 28 2012 Fedora Release Engineering - 0.18.4-2 +- Rebuilt for c++ ABI breakage + +* Sat Feb 18 2012 Rex Dieter 0.18.4-1 +- 0.18.4 + +* Thu Feb 09 2012 Rex Dieter 0.18.3-3 +- rebuild (openjpeg) + +* Tue Jan 17 2012 Rex Dieter 0.18.3-2 +- -devel: don't own all headers + +* Mon Jan 16 2012 Rex Dieter 0.18.3-1 +- 0.18.3 + +* Sat Jan 14 2012 Fedora Release Engineering - 0.18.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Dec 06 2011 Marek Kasik - 0.18.2-1 +- Update to 0.18.2 +- Remove upstreamed patches + +* Mon Dec 05 2011 Adam Jackson 0.18.1-3 +- Rebuild for new libpng + +* Fri Oct 28 2011 Rex Dieter 0.18.1-2 +- poppler-glib.pc pkgconfig file broken (#749898) +- %%check: verify pkgconfig sanity + +* Fri Oct 28 2011 Rex Dieter 0.18.1-1 +- Update to 0.18.1 +- pkgconfig-style deps +- tighten deps with %%_isa + +* Fri Sep 30 2011 Marek Kasik - 0.18.0-2 +- rebuild + +* Fri Sep 30 2011 Marek Kasik - 0.18.0-1 +- Update to 0.18.0 + +* Mon Sep 26 2011 Marek Kasik - 0.17.3-2 +- Don't include pdfextract and pdfmerge in resulting packages for now +- since they conflict with packages pdfmerge and mupdf (#740906) + +* Mon Sep 19 2011 Marek Kasik - 0.17.3-1 +- Update to 0.17.3 + +* Wed Aug 17 2011 Marek Kasik - 0.17.0-2 +- Fix a problem with freeing of memory in PreScanOutputDev (#730941) + +* Fri Jul 15 2011 Marek Kasik - 0.17.0-1 +- Update to 0.17.0 + +* Thu Jun 30 2011 Rex Dieter 0.16.7-1 +- 0.16.7 + +* Wed Jun 22 2011 Marek Kasik - 0.16.6-2 +- Drop dependency on gtk-doc (#604412) + +* Thu Jun 2 2011 Marek Kasik - 0.16.6-1 +- Update to 0.16.6 + +* Thu May 5 2011 Marek Kasik - 0.16.5-1 +- Update to 0.16.5 + +* Thu Mar 31 2011 Marek Kasik - 0.16.4-1 +- Update to 0.16.4 + +* Sun Mar 13 2011 Marek Kasik - 0.16.3-2 +- Update to 0.16.3 + +* Sun Mar 13 2011 Marek Kasik - 0.16.3-1 +- Update to 0.16.3 + +* Wed Feb 09 2011 Fedora Release Engineering - 0.16.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Feb 2 2011 Marek Kasik - 0.16.2-1 +- Update to 0.16.2 + +* Tue Jan 18 2011 Rex Dieter - 0.16.0-3 +- drop qt3 bindings +- rename -qt4 -> -qt + +* Wed Jan 12 2011 Rex Dieter - 0.16.0-2 +- rebuild (openjpeg) + +* Mon Dec 27 2010 Rex Dieter - 0.16.0-1 +- 0.16.0 + +* Fri Dec 10 2010 Marek Kasik - 0.15.3-1 +- Update to 0.15.3 + +* Mon Nov 1 2010 Marek Kasik - 0.15.1-1 +- Update to 0.15.1 +- Remove CVE-2010-3702, 3703 and 3704 patches (they are already in 0.15.1) + +* Thu Oct 7 2010 Marek Kasik - 0.15.0-5 +- Add poppler-0.15.0-CVE-2010-3702.patch + (Properly initialize parser) +- Add poppler-0.15.0-CVE-2010-3703.patch + (Properly initialize stack) +- Add poppler-0.15.0-CVE-2010-3704.patch + (Fix crash in broken pdf (code < 0)) +- Resolves: #639861 + +* Wed Sep 29 2010 jkeating - 0.15.0-4 +- Rebuilt for gcc bug 634757 + +* Mon Sep 27 2010 Marek Kasik - 0.15.0-3 +- Remove explicit requirement of gobject-introspection + +* Fri Sep 24 2010 Marek Kasik - 0.15.0-2 +- Move requirement of gobject-introspection to glib sub-package + +* Fri Sep 24 2010 Marek Kasik - 0.15.0-1 +- Update to 0.15.0 +- Enable introspection + +* Sat Sep 11 2010 Rex Dieter - 0.14.3-1 +- Update to 0.14.3 + +* Thu Aug 19 2010 Marek Kasik - 0.14.2-1 +- Update to 0.14.2 +- Remove poppler-0.12.1-objstream.patch + +* Fri Jul 16 2010 Marek Kasik - 0.14.1-1 +- Update to 0.14.1 +- Don't apply poppler-0.12.1-objstream.patch, it is not needed anymore + +* Fri Jun 18 2010 Matthias Clasen - 0.14.0-1 +- Update to 0.14.0 + +* Wed May 26 2010 Marek Kasik - 0.13.4-1 +- poppler-0.13.4 + +* Mon May 3 2010 Marek Kasik - 0.13.3-2 +- Update "sources" file +- Add BuildRequires "gettext-devel" + +* Fri Apr 30 2010 Marek Kasik - 0.13.3-1 +- poppler-0.13.3 + +* Thu Mar 4 2010 Marek Kasik - 0.12.4-2 +- Fix showing of radio buttons (#480868) + +* Thu Feb 18 2010 Rex Dieter - 0.12.4-1 +- popper-0.12.4 + +* Tue Feb 16 2010 Marek Kasik - 0.12.3-9 +- Fix downscaling of rotated pages (#563353) + +* Thu Jan 28 2010 Marek Kasik - 0.12.3-8 +- Get current FcConfig before using it (#533992) + +* Sun Jan 24 2010 Rex Dieter - 0.12.3-7 +- use alternative/upstream downscale patch (#556549, fdo#5589) + +* Wed Jan 20 2010 Marek Kasik - 0.12.3-6 +- Add dependency on poppler-data (#553991) + +* Tue Jan 19 2010 Rex Dieter - 0.12.3-5 +- cairo backend, scale images correctly (#556549, fdo#5589) + +* Fri Jan 15 2010 Rex Dieter - 0.12.3-4 +- Sanitize versioned Obsoletes/Provides + +* Fri Jan 15 2010 Marek Kasik - 0.12.3-3 +- Correct permissions of goo/GooTimer.h +- Convert pdftohtml.1 to utf8 +- Make the pdftohtml's Provides/Obsoletes versioned + +* Thu Jan 07 2010 Rex Dieter - 0.12.3-1 +- poppler-0.12.3 + +* Mon Nov 23 2009 Rex Dieter - 0.12.2-1 +- poppler-0.12.2 + +* Sun Oct 25 2009 Rex Dieter - 0.12.1-3 +- CVE-2009-3607 poppler: create_surface_from_thumbnail_data + integer overflow (#526924) + +* Mon Oct 19 2009 Rex Dieter - 0.12.1-1 +- poppler-0.12.1 +- deprecate xpdf/pdftohtml Conflicts/Obsoletes + +* Wed Sep 09 2009 Rex Dieter - 0.12.0-1 +- Update to 0.12.0 + +* Tue Aug 18 2009 Rex Dieter - 0.11.3-1 +- Update to 0.11.3 + +* Mon Aug 3 2009 Matthias Clasen - 0.11.2-1 +- Update to 0.11.2 + +* Sun Jul 26 2009 Fedora Release Engineering - 0.11.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Jun 23 2009 Rex Dieter - 0.11.1-2 +- omit poppler-data (#507675) + +* Tue Jun 23 2009 Rex Dieter - 0.11.1-1 +- poppler-0.11.1 + +* Mon Jun 22 2009 Rex Dieter - 0.11.0-6 +- reduce lib deps in qt/qt4 pkg-config support + +* Sat Jun 20 2009 Rex Dieter - 0.11.0-5 +- --enable-libjpeg +- (explicitly) --disable-zlib + +* Fri Jun 19 2009 Rex Dieter - 0.11.0-3 +- --enable-libopenjpeg, --disable-zlib + +* Sun May 24 2009 Rex Dieter - 0.11.0-2 +- update changelog +- track sonames + +* Tue May 19 2009 Bastien Nocera - 0.11.0-1 +- Update to 0.11.0 + +* Thu Mar 12 2009 Matthias Clasen - 0.10.5-1 +- Update to 0.10.5 + +* Thu Feb 26 2009 Fedora Release Engineering - 0.10.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Feb 17 2009 Matthias Clasen - 0.10.4-1 +- Update to 0.10.4 + +* Tue Jan 20 2009 Rex Dieter - 0.10.3-2 +- add needed scriptlets +- nuke rpaths + +* Tue Jan 13 2009 Matthias Clasen - 0.10.3-1 +- Update to 0.10.3 + +* Wed Dec 17 2008 Matthias Clasen - 0.10.2-1 +- Update to 0.10.2 + +* Tue Nov 11 2008 Matthias Clasen - 0.10.1-1 +- Update to 0.10.1 and -data 0.2.1 + +* Tue Sep 16 2008 Rex Dieter - 0.8.7-2 +- cleanup qt3 hack +- %%description cosmetics + +* Sun Sep 7 2008 Matthias Clasen - 0.8.7-1 +- Update to 0.8.7 + +* Fri Aug 22 2008 Matthias Clasen - 0.8.6-1 +- Update to 0.8.6 + +* Tue Aug 05 2008 Colin Walters - 0.8.5-1 +- Update to 0.8.5 + +* Wed Jun 4 2008 Matthias Clasen - 0.8.3-1 +- Update to 0.8.3 + +* Mon Apr 28 2008 Matthias Clasen - 0.8.1-1 +- Update to 0.8.1 + +* Sun Apr 06 2008 Adam Jackson 0.8.0-3 +- poppler-0.8.0-ocg-crash.patch: Fix a crash when no optional content + groups are defined. +- Mangle configure to account for the new directory for qt3 libs. +- Fix grammar in %%description. + +* Tue Apr 01 2008 Rex Dieter - 0.8.0-2 +- -qt-devel: Requires: qt3-devel + +* Sun Mar 30 2008 Matthias Clasen - 0.8.0-1 +- Update to 0.8.0 + +* Sun Mar 23 2008 Matthias Clasen - 0.7.3-1 +- Update to 0.7.3 + +* Wed Mar 12 2008 Matthias Clasen - 0.7.2-1 +- Update to 0.7.2 + +* Thu Feb 28 2008 Matthias Clasen - 0.7.1-1 +- Update to 0.7.1 + +* Thu Feb 21 2008 Matthias Clasen - 0.7.0-1 +- Update to 0.7.0 + +* Tue Feb 19 2008 Fedora Release Engineering - 0.6.4-4 +- Autorebuild for GCC 4.3 + +* Mon Feb 18 2008 Jindrich Novy - 0.6.4-3 +- apply ObjStream patch (#433090) + +* Tue Jan 29 2008 Matthias Clasen - 0.6.4-2 +- Add some required inter-subpackge deps + +* Tue Jan 29 2008 Matthias Clasen - 0.6.4-1 +- Update to 0.6.4 +- Split off poppler-glib + +* Sun Dec 2 2007 Matthias Clasen - 0.6.2-3 +- Fix the qt3 checks some more + +* Wed Nov 28 2007 Matthias Clasen - 0.6.2-2 +- package xpdf headers in poppler-devel (Jindrich Novy) +- Fix qt3 detection (Denis Leroy) + +* Thu Nov 22 2007 Matthias Clasen - 0.6.2-1 +- Update to 0.6.2 + +* Thu Oct 11 2007 Rex Dieter - 0.6-2 +- include qt4 wrapper + +* Tue Sep 4 2007 Kristian Høgsberg - 0.6-1 +- Update to 0.6 + +* Wed Aug 15 2007 Matthias Clasen - 0.5.91-2 +- Remove debug spew + +* Tue Aug 14 2007 Matthias Clasen - 0.5.91-1 +- Update to 0.5.91 + +* Wed Aug 8 2007 Matthias Clasen - 0.5.9-2 +- Update the license field + +* Mon Jun 18 2007 Matthias Clasen - 0.5.9-1 +- Update to 0.5.9 + +* Thu Mar 1 2007 Bill Nottingham - 0.5.4-7 +- fix it so the qt pkgconfig/.so aren't in the main poppler-devel + +* Fri Dec 15 2006 Matthias Clasen - 0.5.4-5 +- Include epoch in the Provides/Obsoletes for xpdf-utils + +* Wed Dec 13 2006 Matthias Clasen - 0.5.4-4 +- Add Provides/Obsoletes for xpdf-utils (#219033) + +* Fri Dec 08 2006 Rex Dieter - 0.5.4-3 +- drop hard-wired: Req: gtk2 +- --disable-static +- enable qt wrapper +- -devel: Requires: pkgconfig + +* Sun Oct 01 2006 Jesse Keating - 0.5.4-2 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Thu Sep 21 2006 Kristian Høgsberg - 0.5.4-1.fc6 +- Rebase to 0.5.4, drop poppler-0.5.3-libs.patch, fixes #205813, + #205549, #200613, #172137, #172138, #161293 and more. + +* Wed Sep 13 2006 Kristian Høgsberg - 0.5.3-3.fc6 +- Move .so to -devel (#203637). + +* Mon Aug 14 2006 Matthias Clasen - 0.5.3-2.fc6 +- link against fontconfig (see bug 202256) + +* Wed Jul 12 2006 Jesse Keating - 0.5.3-1.1 +- rebuild + +* Wed May 31 2006 Kristian Høgsberg 0.5.3-1 +- Update to 0.5.3. + +* Mon May 22 2006 Kristian Høgsberg 0.5.2-1 +- Update to 0.5.2. + +* Wed Mar 1 2006 Kristian Høgsberg 0.5.1-2 +- Rebuild the get rid of old soname dependency. + +* Tue Feb 28 2006 Kristian Høgsberg 0.5.1-1 +- Update to version 0.5.1. + +* Fri Feb 10 2006 Jesse Keating - 0.5.0-4.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 0.5.0-4.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Wed Jan 18 2006 Ray Strode - 0.5.0-4 +- change xpdf conflict version to be <= instead of < + +* Wed Jan 18 2006 Ray Strode - 0.5.0-3 +- update conflicts: xpdf line to be versioned + +* Wed Jan 11 2006 Kristian Høgsberg - 0.5.0-2.0 +- Update to 0.5.0 and add poppler-utils subpackage. +- Flesh out poppler-utils subpackage. + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Sun Sep 4 2005 Kristian Høgsberg - 0.4.2-1 +- Update to 0.4.2 and disable splash backend so we don't build it. + +* Fri Aug 26 2005 Marco Pesenti Gritti - 0.4.1-2 +- Rebuild + +* Fri Aug 26 2005 Marco Pesenti Gritti - 0.4.1-1 +- Update to 0.4.1 + +* Wed Aug 17 2005 Kristian Høgsberg - 0.4.0-2 +- Bump release and rebuild. + +* Wed Aug 17 2005 Marco Pesenti gritti - 0.4.0-1 +- Update to 0.4.0 + +* Mon Aug 15 2005 Kristian Høgsberg - 0.3.3-2 +- Rebuild to pick up new cairo soname. + +* Mon Jun 20 2005 Kristian Høgsberg - 0.3.3-1 +- Update to 0.3.3 and change to build cairo backend. + +* Sun May 22 2005 Marco Pesenti gritti - 0.3.2-1 +- Update to 0.3.2 + +* Sat May 7 2005 Marco Pesenti Gritti - 0.3.1 +- Update to 0.3.1 + +* Sat Apr 23 2005 Marco Pesenti Gritti - 0.3.0 +- Update to 0.3.0 + +* Wed Apr 13 2005 Florian La Roche +- remove empty post/postun scripts + +* Wed Apr 6 2005 Marco Pesenti Gritti - 0.2.0-1 +- Update to 0.2.0 + +* Sat Mar 12 2005 Marco Pesenti Gritti - 0.1.2-1 +- Update to 0.1.2 +- Use tar.gz because there are not bz of poppler + +* Wed Mar 2 2005 Marco Pesenti Gritti - 0.1.1-1 +- Initial build