Package init
This commit is contained in:
commit
85de9257f1
26541
0001-Revert-Remove-the-Qt4-frontend.patch
Normal file
26541
0001-Revert-Remove-the-Qt4-frontend.patch
Normal file
File diff suppressed because it is too large
Load Diff
46
CVE-2018-20662-1.patch
Normal file
46
CVE-2018-20662-1.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 7b4e372deeb716eb3fe3a54b31ed41af759224f9 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Mon, 4 Mar 2019 12:55:12 +0100
|
||||
Subject: [PATCH] pdfunite: Check XRef's Catalog for being a Dict
|
||||
|
||||
Check whether Catalog from XRef is Dict for each document
|
||||
passed to pdfunite and return error if not.
|
||||
|
||||
https://gitlab.freedesktop.org/poppler/poppler/issues/706
|
||||
---
|
||||
utils/pdfunite.cc | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/utils/pdfunite.cc b/utils/pdfunite.cc
|
||||
index b0142116..23888684 100644
|
||||
--- a/utils/pdfunite.cc
|
||||
+++ b/utils/pdfunite.cc
|
||||
@@ -165,7 +165,8 @@ int main (int argc, char *argv[])
|
||||
for (i = 1; i < argc - 1; i++) {
|
||||
GooString *gfileName = new GooString(argv[i]);
|
||||
PDFDoc *doc = new PDFDoc(gfileName, nullptr, nullptr, nullptr);
|
||||
- if (doc->isOk() && !doc->isEncrypted()) {
|
||||
+ if (doc->isOk() && !doc->isEncrypted() &&
|
||||
+ doc->getXRef()->getCatalog().isDict()) {
|
||||
docs.push_back(doc);
|
||||
if (doc->getPDFMajorVersion() > majorVersion) {
|
||||
majorVersion = doc->getPDFMajorVersion();
|
||||
@@ -176,8 +177,13 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
} else if (doc->isOk()) {
|
||||
- error(errUnimplemented, -1, "Could not merge encrypted files ('{0:s}')", argv[i]);
|
||||
- return -1;
|
||||
+ if (doc->isEncrypted()) {
|
||||
+ error(errUnimplemented, -1, "Could not merge encrypted files ('{0:s}')", argv[i]);
|
||||
+ return -1;
|
||||
+ } else if (!doc->getXRef()->getCatalog().isDict()) {
|
||||
+ error(errSyntaxError, -1, "XRef's Catalog is not a dictionary ('{0:s}')", argv[i]);
|
||||
+ return -1;
|
||||
+ }
|
||||
} else {
|
||||
error(errSyntaxError, -1, "Could not merge damaged documents ('{0:s}')", argv[i]);
|
||||
return -1;
|
||||
--
|
||||
2.21.0
|
||||
|
||||
28
CVE-2018-20662-2.patch
Normal file
28
CVE-2018-20662-2.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 9fd5ec0e6e5f763b190f2a55ceb5427cfe851d5f Mon Sep 17 00:00:00 2001
|
||||
From: Albert Astals Cid <aacid@kde.org>
|
||||
Date: Mon, 31 Dec 2018 11:47:57 +0100
|
||||
Subject: [PATCH] PDFDoc::setup: Fix return value
|
||||
|
||||
At that point xref can have gone wrong since extractPDFSubtype() can
|
||||
have caused a reconstruct that broke stuff so instead of unconditionally
|
||||
returning true, return xref->isOk()
|
||||
|
||||
Fixes #706
|
||||
---
|
||||
poppler/PDFDoc.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
|
||||
index 351bd2ea..9213f567 100644
|
||||
--- a/poppler/PDFDoc.cc
|
||||
+++ b/poppler/PDFDoc.cc
|
||||
@@ -312,6 +312,6 @@ bool PDFDoc::setup(const GooString *ownerPassword, const GooString *userPassword
|
||||
|
||||
// done
|
||||
- return gTrue;
|
||||
+ return xref->isOk();
|
||||
}
|
||||
|
||||
PDFDoc::~PDFDoc() {
|
||||
--
|
||||
2.21.0
|
||||
35
CVE-2019-9631-1.patch
Normal file
35
CVE-2019-9631-1.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From d716e636231c8d636bf2139896d817b66fe6d510 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Thu, 21 Mar 2019 13:15:37 +0100
|
||||
Subject: [PATCH] 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; i<dest_length; i++)
|
||||
{
|
||||
- float left_side = i*scale;
|
||||
- float right_side = (i+1)*scale;
|
||||
- float right_fract = right_side - floor (right_side);
|
||||
- float left_fract = ceil (left_side) - left_side;
|
||||
+ double left_side = i*scale;
|
||||
+ double right_side = (i+1)*scale;
|
||||
+ double right_fract = right_side - floor (right_side);
|
||||
+ double left_fract = ceil (left_side) - left_side;
|
||||
int overage;
|
||||
/* find out how many source pixels will be used to fill the box */
|
||||
int count = floor (right_side) - ceil (left_side);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
100
CVE-2019-9631-2.patch
Normal file
100
CVE-2019-9631-2.patch
Normal file
@ -0,0 +1,100 @@
|
||||
From 8122f6d6d409b53151a20c5578fc525ee97315e8 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Thu, 21 Mar 2019 13:47:51 +0100
|
||||
Subject: [PATCH] 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.21.0
|
||||
|
||||
26
CVE-2019-9903.patch
Normal file
26
CVE-2019-9903.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From fada09a2ccc11a3a1d308e810f1336d8df6011fd Mon Sep 17 00:00:00 2001
|
||||
From: Albert Astals Cid <aacid@kde.org>
|
||||
Date: Mon, 18 Mar 2019 00:50:00 +0100
|
||||
Subject: [PATCH] pdfunite: Fix stack overflow on broken file
|
||||
|
||||
Fixes issue #741
|
||||
---
|
||||
poppler/PDFDoc.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
|
||||
index 26842f84..ab4abcad 100644
|
||||
--- a/poppler/PDFDoc.cc
|
||||
+++ b/poppler/PDFDoc.cc
|
||||
@@ -1703,7 +1703,7 @@ void PDFDoc::markObject (Object* obj, XRef *xRef, XRef *countRef, unsigned int n
|
||||
array = obj->getArray();
|
||||
for (int i=0; i<array->getLength(); i++) {
|
||||
Object obj1 = array->getNF(i);
|
||||
- markObject(&obj1, xRef, countRef, numOffset, oldRefNum, newRefNum);
|
||||
+ markObject(&obj1, xRef, countRef, numOffset, oldRefNum, newRefNum, alreadyMarkedDicts);
|
||||
}
|
||||
break;
|
||||
case objDict:
|
||||
--
|
||||
2.21.0
|
||||
|
||||
22
CVE-2019-9959.patch
Normal file
22
CVE-2019-9959.patch
Normal file
@ -0,0 +1,22 @@
|
||||
From 68ef84e5968a4249c2162b839ca6d7975048a557 Mon Sep 17 00:00:00 2001
|
||||
From: Albert Astals Cid <aacid@kde.org>
|
||||
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 -Nurp poppler-0.67.0/poppler/JPEG2000Stream.cc poppler-0.67.0-bak/poppler/JPEG2000Stream.cc
|
||||
--- poppler-0.67.0/poppler/JPEG2000Stream.cc 2018-07-19 17:20:03.000000000 -0400
|
||||
+++ poppler-0.67.0-bak/poppler/JPEG2000Stream.cc 2019-08-15 14:10:20.618000000 -0400
|
||||
@@ -219,7 +219,7 @@ void JPXStream::init()
|
||||
}
|
||||
|
||||
int bufSize = BUFFER_INITIAL_SIZE;
|
||||
- if (oLen.isInt()) bufSize = oLen.getInt();
|
||||
+ if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();
|
||||
|
||||
GBool indexed = gFalse;
|
||||
if (cspace.isArray() && cspace.arrayGetLength() > 0) {
|
||||
285
poppler-0.30.0-rotated-words-selection.patch
Normal file
285
poppler-0.30.0-rotated-words-selection.patch
Normal file
@ -0,0 +1,285 @@
|
||||
From 0ab1f29d4ce315b0fca260c0e0f3007024d00342 Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
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
|
||||
@@ -178,6 +178,12 @@
|
||||
#define combMaxMidDelta 0.3
|
||||
#define combMaxBaseDelta 0.4
|
||||
|
||||
+// 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)
|
||||
+
|
||||
static int reorderText(Unicode *text, int len, UnicodeMap *uMap, GBool primaryLR, GooString *s, Unicode* u) {
|
||||
char lre[8], rle[8], popdf[8], buf[8];
|
||||
int lreLen = 0, rleLen = 0, popdfLen = 0, n;
|
||||
@@ -4411,11 +4417,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),
|
||||
@@ -4499,19 +4531,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);
|
||||
@@ -4589,17 +4658,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. */
|
||||
@@ -4615,30 +4694,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 = nullptr;
|
||||
end = nullptr;
|
||||
current = nullptr;
|
||||
for (p = words; p != nullptr; 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 == nullptr)
|
||||
- begin = p;
|
||||
+ if (((s1 < p_max) || (s2 < p_max)) && begin == nullptr)
|
||||
+ begin = p;
|
||||
|
||||
- if (((selection->x1 > p->xMin) ||
|
||||
- (selection->x2 > p->xMin)) && (begin != nullptr)) {
|
||||
+ if (((s1 > p_min) || (s2 > p_min)) && begin != nullptr) {
|
||||
end = p->next;
|
||||
current = p;
|
||||
}
|
||||
} else {
|
||||
- if ((selection->x1 > p->xMin) ||
|
||||
- (selection->x2 > p->xMin))
|
||||
- if (begin == nullptr)
|
||||
- begin = p;
|
||||
+ if (((s1 > p_min) || (s2 > p_min)) && begin == nullptr)
|
||||
+ begin = p;
|
||||
|
||||
- if (((selection->x1 < p->xMax) ||
|
||||
- (selection->x2 < p->xMax)) && (begin != nullptr)) {
|
||||
+ if (((s1 < p_max) || (s2 < p_max)) && begin != nullptr) {
|
||||
end = p->next;
|
||||
current = p;
|
||||
}
|
||||
@@ -4650,23 +4740,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
|
||||
|
||||
8
poppler-0.63.0-python3.patch
Normal file
8
poppler-0.63.0-python3.patch
Normal file
@ -0,0 +1,8 @@
|
||||
--- poppler-0.63.0/make-glib-api-docs
|
||||
+++ poppler-0.63.0/make-glib-api-docs
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/usr/bin/env python
|
||||
+#!/usr/bin/python3
|
||||
#
|
||||
# Copyright (C) 2017 Carlos Garcia Campos <carlosgc@gnome.org>
|
||||
#
|
||||
47
poppler-0.63.0-tiling-patterns.patch
Normal file
47
poppler-0.63.0-tiling-patterns.patch
Normal file
@ -0,0 +1,47 @@
|
||||
From 718d428984e3a84fda521c0f5e6d975c7390af2b Mon Sep 17 00:00:00 2001
|
||||
From: Marek Kasik <mkasik@redhat.com>
|
||||
Date: Fri, 6 Apr 2018 15:06:46 +0200
|
||||
Subject: [PATCH] cairo: Fix tiling patterns when pattern cell is too far
|
||||
|
||||
Rendering of tiling pattern which has pattern matrix moving pattern cell
|
||||
far away can fail on allocation of memory. This commit solves the issue by
|
||||
modifying of cairo pattern matrix so that its offset is closer to the path
|
||||
filled by the pattern.
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=105905
|
||||
---
|
||||
poppler/CairoOutputDev.cc | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
|
||||
index 631ab27b..b2e730bf 100644
|
||||
--- a/poppler/CairoOutputDev.cc
|
||||
+++ b/poppler/CairoOutputDev.cc
|
||||
@@ -915,6 +915,8 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
|
||||
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];
|
||||
@@ -976,6 +978,15 @@ GBool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat
|
||||
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);
|
||||
|
||||
--
|
||||
2.14.3
|
||||
|
||||
404
poppler-0.67.0-qt4-const.patch
Normal file
404
poppler-0.67.0-qt4-const.patch
Normal file
@ -0,0 +1,404 @@
|
||||
--- poppler-0.67.0/qt4/src/ArthurOutputDev.cc.orig 2018-08-08 10:13:17.127028046 +0200
|
||||
+++ poppler-0.67.0/qt4/src/ArthurOutputDev.cc 2018-08-08 11:13:37.377483041 +0200
|
||||
@@ -68,7 +68,7 @@
|
||||
class SplashOutFontFileID: public SplashFontFileID {
|
||||
public:
|
||||
|
||||
- SplashOutFontFileID(Ref *rA) { r = *rA; }
|
||||
+ SplashOutFontFileID(const Ref *rA) { r = *rA; }
|
||||
|
||||
~SplashOutFontFileID() {}
|
||||
|
||||
--- poppler-0.67.0/qt4/src/poppler-annotation.cc.orig 2018-08-08 10:13:17.129028061 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-annotation.cc 2018-08-08 10:44:58.038166746 +0200
|
||||
@@ -534,7 +534,7 @@ QList<Annotation*> AnnotationPrivate::fi
|
||||
MovieObject *movie = new MovieObject( movieann );
|
||||
m->setMovie( movie );
|
||||
// -> movieTitle
|
||||
- GooString * movietitle = movieann->getTitle();
|
||||
+ const GooString * movietitle = movieann->getTitle();
|
||||
if ( movietitle )
|
||||
m->setMovieTitle( QString::fromLatin1( movietitle->getCString() ) );
|
||||
break;
|
||||
@@ -554,7 +554,7 @@ QList<Annotation*> AnnotationPrivate::fi
|
||||
s->setAction( static_cast<Poppler::LinkRendition *>(popplerLink) );
|
||||
|
||||
// -> screenTitle
|
||||
- GooString * screentitle = screenann->getTitle();
|
||||
+ const GooString * screentitle = screenann->getTitle();
|
||||
if ( screentitle )
|
||||
s->setScreenTitle( UnicodeParsedString( screentitle ) );
|
||||
break;
|
||||
--- poppler-0.67.0/qt4/src/poppler-document.cc.orig 2018-08-08 10:13:17.130028069 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-document.cc 2018-08-08 11:14:58.301690615 +0200
|
||||
@@ -605,7 +605,7 @@ namespace Poppler {
|
||||
if ( !outline )
|
||||
return NULL;
|
||||
|
||||
- GooList * items = outline->getItems();
|
||||
+ const GooList * items = outline->getItems();
|
||||
if ( !items || items->getLength() < 1 )
|
||||
return NULL;
|
||||
|
||||
@@ -799,7 +799,7 @@ namespace Poppler {
|
||||
return Document::NoForm; // make gcc happy
|
||||
}
|
||||
|
||||
- QDateTime convertDate( char *dateString )
|
||||
+ QDateTime convertDate( const char *dateString )
|
||||
{
|
||||
int year, mon, day, hour, min, sec, tzHours, tzMins;
|
||||
char tz;
|
||||
@@ -830,6 +830,12 @@ namespace Poppler {
|
||||
return QDateTime();
|
||||
}
|
||||
|
||||
+ QDateTime convertDate( char *dateString )
|
||||
+ {
|
||||
+ return convertDate( (const char *) dateString );
|
||||
+ }
|
||||
+
|
||||
+
|
||||
bool isCmsAvailable()
|
||||
{
|
||||
#if defined(USE_CMS)
|
||||
--- poppler-0.67.0/qt4/src/poppler-embeddedfile.cc.orig 2018-08-08 10:13:17.130028069 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-embeddedfile.cc 2018-08-08 10:50:42.645723179 +0200
|
||||
@@ -68,13 +68,13 @@ EmbeddedFile::~EmbeddedFile()
|
||||
|
||||
QString EmbeddedFile::name() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->filespec->getFileName();
|
||||
+ const GooString *goo = m_embeddedFile->filespec->getFileName();
|
||||
return goo ? UnicodeParsedString(goo) : QString();
|
||||
}
|
||||
|
||||
QString EmbeddedFile::description() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->filespec->getDescription();
|
||||
+ const GooString *goo = m_embeddedFile->filespec->getDescription();
|
||||
return goo ? UnicodeParsedString(goo) : QString();
|
||||
}
|
||||
|
||||
@@ -85,25 +85,25 @@ int EmbeddedFile::size() const
|
||||
|
||||
QDateTime EmbeddedFile::modDate() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL;
|
||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->modDate() : NULL;
|
||||
return goo ? convertDate(goo->getCString()) : QDateTime();
|
||||
}
|
||||
|
||||
QDateTime EmbeddedFile::createDate() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL;
|
||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->createDate() : NULL;
|
||||
return goo ? convertDate(goo->getCString()) : QDateTime();
|
||||
}
|
||||
|
||||
QByteArray EmbeddedFile::checksum() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL;
|
||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->checksum() : NULL;
|
||||
return goo ? QByteArray::fromRawData(goo->getCString(), goo->getLength()) : QByteArray();
|
||||
}
|
||||
|
||||
QString EmbeddedFile::mimeType() const
|
||||
{
|
||||
- GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL;
|
||||
+ const GooString *goo = m_embeddedFile->embFile() ? m_embeddedFile->embFile()->mimeType() : NULL;
|
||||
return goo ? QString(goo->getCString()) : QString();
|
||||
}
|
||||
|
||||
--- poppler-0.67.0/qt4/src/poppler-form.cc.orig 2018-08-08 10:13:17.130028069 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-form.cc 2018-08-08 10:51:46.240825862 +0200
|
||||
@@ -104,7 +104,7 @@ int FormField::id() const
|
||||
QString FormField::name() const
|
||||
{
|
||||
QString name;
|
||||
- if (GooString *goo = m_formData->fm->getPartialName())
|
||||
+ if (const GooString *goo = m_formData->fm->getPartialName())
|
||||
{
|
||||
name = QString::fromLatin1(goo->getCString());
|
||||
}
|
||||
@@ -114,7 +114,7 @@ QString FormField::name() const
|
||||
QString FormField::fullyQualifiedName() const
|
||||
{
|
||||
QString name;
|
||||
- if (GooString *goo = m_formData->fm->getFullyQualifiedName())
|
||||
+ if (const GooString *goo = m_formData->fm->getFullyQualifiedName())
|
||||
{
|
||||
name = UnicodeParsedString(goo);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ QString FormField::fullyQualifiedName()
|
||||
QString FormField::uiName() const
|
||||
{
|
||||
QString name;
|
||||
- if (GooString *goo = m_formData->fm->getAlternateUiName())
|
||||
+ if (const GooString *goo = m_formData->fm->getAlternateUiName())
|
||||
{
|
||||
name = QString::fromLatin1(goo->getCString());
|
||||
}
|
||||
@@ -271,7 +271,7 @@ FormFieldText::TextType FormFieldText::t
|
||||
|
||||
QString FormFieldText::text() const
|
||||
{
|
||||
- GooString *goo = static_cast<FormWidgetText*>(m_formData->fm)->getContent();
|
||||
+ const GooString *goo = static_cast<FormWidgetText*>(m_formData->fm)->getContent();
|
||||
return UnicodeParsedString(goo);
|
||||
}
|
||||
|
||||
--- poppler-0.67.0/qt4/src/poppler-link.cc.orig 2018-08-08 10:13:17.131028077 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-link.cc 2018-08-08 10:59:12.395546232 +0200
|
||||
@@ -232,7 +232,7 @@ class LinkMoviePrivate : public LinkPriv
|
||||
: d( new LinkDestinationPrivate )
|
||||
{
|
||||
bool deleteDest = false;
|
||||
- LinkDest *ld = data.ld;
|
||||
+ const LinkDest *ld = data.ld;
|
||||
|
||||
if ( data.namedDest && !ld && !data.externalDest )
|
||||
{
|
||||
--- poppler-0.67.0/qt4/src/poppler-media.cc.orig 2018-08-08 10:13:17.131028077 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-media.cc 2018-08-08 11:10:51.802056415 +0200
|
||||
@@ -151,7 +151,7 @@ QSize
|
||||
MediaRendition::size() const
|
||||
{
|
||||
Q_D( const MediaRendition );
|
||||
- MediaParameters *mp = 0;
|
||||
+ const MediaParameters *mp = 0;
|
||||
|
||||
if (d->rendition->getBEParameters())
|
||||
mp = d->rendition->getBEParameters();
|
||||
--- poppler-0.67.0/qt4/src/poppler-movie.cc.orig 2018-08-08 10:13:17.131028077 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-movie.cc 2018-08-08 10:52:41.284914743 +0200
|
||||
@@ -57,7 +57,7 @@ MovieObject::MovieObject( AnnotMovie *an
|
||||
m_movieData->m_movieObj = ann->getMovie()->copy();
|
||||
//TODO: copy poster image
|
||||
|
||||
- MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
|
||||
+ const MovieActivationParameters *mp = m_movieData->m_movieObj->getActivationParameters();
|
||||
int width, height;
|
||||
m_movieData->m_movieObj->getFloatingWindowSize(&width, &height);
|
||||
m_movieData->m_size = QSize(width, height);
|
||||
@@ -73,7 +73,7 @@ MovieObject::~MovieObject()
|
||||
|
||||
QString MovieObject::url() const
|
||||
{
|
||||
- GooString * goo = m_movieData->m_movieObj->getFileName();
|
||||
+ const GooString * goo = m_movieData->m_movieObj->getFileName();
|
||||
return goo ? QString( goo->getCString() ) : QString();
|
||||
}
|
||||
|
||||
--- poppler-0.67.0/qt4/src/poppler-optcontent.cc.orig 2018-08-08 10:13:17.131028077 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-optcontent.cc 2018-08-08 10:53:34.222000220 +0200
|
||||
@@ -213,7 +213,7 @@ namespace Poppler
|
||||
} else if ( (orderItem.isArray()) && (orderItem.arrayGetLength() > 0) ) {
|
||||
parseOrderArray(lastItem, orderItem.getArray());
|
||||
} else if ( orderItem.isString() ) {
|
||||
- GooString *label = orderItem.getString();
|
||||
+ const GooString *label = orderItem.getString();
|
||||
OptContentItem *header = new OptContentItem ( UnicodeParsedString ( label ) );
|
||||
m_headerOptContentItems.append( header );
|
||||
addChild( parentNode, header );
|
||||
@@ -396,7 +396,7 @@ namespace Poppler
|
||||
|
||||
QSet<OptContentItem *> changedItems;
|
||||
|
||||
- GooList *statesList = popplerLinkOCGState->getStateList();
|
||||
+ const GooList *statesList = popplerLinkOCGState->getStateList();
|
||||
for (int i = 0; i < statesList->getLength(); ++i) {
|
||||
::LinkOCGState::StateList *stateList = (::LinkOCGState::StateList*)statesList->get(i);
|
||||
|
||||
--- poppler-0.67.0/qt4/src/poppler-page.cc.orig 2018-08-08 10:13:17.132028085 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-page.cc 2018-08-08 10:54:22.980078936 +0200
|
||||
@@ -103,7 +103,7 @@ Link* PageData::convertLinkActionToLink(
|
||||
case actionLaunch:
|
||||
{
|
||||
LinkLaunch * e = (LinkLaunch *)a;
|
||||
- GooString * p = e->getParams();
|
||||
+ const GooString * p = e->getParams();
|
||||
popplerLink = new LinkExecute( linkArea, e->getFileName()->getCString(), p ? p->getCString() : 0 );
|
||||
}
|
||||
break;
|
||||
--- poppler-0.67.0/qt4/src/poppler-private.cc.orig 2018-08-08 10:13:17.132028085 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-private.cc 2018-08-08 11:03:25.964955666 +0200
|
||||
@@ -73,7 +73,7 @@ namespace Debug {
|
||||
(*Debug::debugFunction)(emsg, Debug::debugClosure);
|
||||
}
|
||||
|
||||
- QString unicodeToQString(Unicode* u, int len) {
|
||||
+ QString unicodeToQString(const Unicode* u, int len) {
|
||||
if (!utf8Map)
|
||||
{
|
||||
GooString enc("UTF-8");
|
||||
@@ -98,11 +98,11 @@ namespace Debug {
|
||||
return QString::fromUtf8(convertedStr.getCString(), convertedStr.getLength());
|
||||
}
|
||||
|
||||
- QString UnicodeParsedString(GooString *s1) {
|
||||
+ QString UnicodeParsedString(const GooString *s1) {
|
||||
if ( !s1 || s1->getLength() == 0 )
|
||||
return QString();
|
||||
|
||||
- char *cString;
|
||||
+ const char *cString;
|
||||
int stringLength;
|
||||
bool deleteCString;
|
||||
if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) )
|
||||
@@ -162,7 +162,7 @@ namespace Debug {
|
||||
return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'"));
|
||||
}
|
||||
|
||||
- static void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e )
|
||||
+ static void linkActionToTocItem( const ::LinkAction * a, DocumentData * doc, QDomElement * e )
|
||||
{
|
||||
if ( !a || !e )
|
||||
return;
|
||||
@@ -172,14 +172,14 @@ namespace Debug {
|
||||
case actionGoTo:
|
||||
{
|
||||
// page number is contained/referenced in a LinkGoTo
|
||||
- LinkGoTo * g = static_cast< LinkGoTo * >( a );
|
||||
- LinkDest * destination = g->getDest();
|
||||
+ const LinkGoTo * g = static_cast< const LinkGoTo * >( a );
|
||||
+ const LinkDest * destination = g->getDest();
|
||||
if ( !destination && g->getNamedDest() )
|
||||
{
|
||||
// no 'destination' but an internal 'named reference'. we could
|
||||
// get the destination for the page now, but it's VERY time consuming,
|
||||
// so better storing the reference and provide the viewport on demand
|
||||
- GooString *s = g->getNamedDest();
|
||||
+ const GooString *s = g->getNamedDest();
|
||||
QChar *charArray = new QChar[s->getLength()];
|
||||
for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]);
|
||||
QString aux(charArray, s->getLength());
|
||||
@@ -196,14 +196,14 @@ namespace Debug {
|
||||
case actionGoToR:
|
||||
{
|
||||
// page number is contained/referenced in a LinkGoToR
|
||||
- LinkGoToR * g = static_cast< LinkGoToR * >( a );
|
||||
- LinkDest * destination = g->getDest();
|
||||
+ const LinkGoToR * g = static_cast< const LinkGoToR * >( a );
|
||||
+ const LinkDest * destination = g->getDest();
|
||||
if ( !destination && g->getNamedDest() )
|
||||
{
|
||||
// no 'destination' but an internal 'named reference'. we could
|
||||
// get the destination for the page now, but it's VERY time consuming,
|
||||
// so better storing the reference and provide the viewport on demand
|
||||
- GooString *s = g->getNamedDest();
|
||||
+ const GooString *s = g->getNamedDest();
|
||||
QChar *charArray = new QChar[s->getLength()];
|
||||
for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]);
|
||||
QString aux(charArray, s->getLength());
|
||||
@@ -220,7 +220,7 @@ namespace Debug {
|
||||
}
|
||||
case actionURI:
|
||||
{
|
||||
- LinkURI * u = static_cast< LinkURI * >( a );
|
||||
+ const LinkURI * u = static_cast< const LinkURI * >( a );
|
||||
e->setAttribute( "DestinationURI", u->getURI()->getCString() );
|
||||
}
|
||||
default: ;
|
||||
@@ -260,7 +260,7 @@ namespace Debug {
|
||||
}
|
||||
|
||||
|
||||
- void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, GooList * items )
|
||||
+ void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, const GooList * items )
|
||||
{
|
||||
int numItems = items->getLength();
|
||||
for ( int i = 0; i < numItems; ++i )
|
||||
@@ -270,7 +270,7 @@ namespace Debug {
|
||||
|
||||
// 1. create element using outlineItem's title as tagName
|
||||
QString name;
|
||||
- Unicode * uniChar = outlineItem->getTitle();
|
||||
+ const Unicode * uniChar = outlineItem->getTitle();
|
||||
int titleLength = outlineItem->getTitleLength();
|
||||
name = unicodeToQString(uniChar, titleLength);
|
||||
if ( name.isEmpty() )
|
||||
@@ -280,14 +280,14 @@ namespace Debug {
|
||||
parent->appendChild( item );
|
||||
|
||||
// 2. find the page the link refers to
|
||||
- ::LinkAction * a = outlineItem->getAction();
|
||||
+ const ::LinkAction * a = outlineItem->getAction();
|
||||
linkActionToTocItem( a, this, &item );
|
||||
|
||||
item.setAttribute( "Open", QVariant( (bool)outlineItem->isOpen() ).toString() );
|
||||
|
||||
// 3. recursively descend over children
|
||||
outlineItem->open();
|
||||
- GooList * children = outlineItem->getKids();
|
||||
+ const GooList * children = outlineItem->getKids();
|
||||
if ( children )
|
||||
addTocChildren( docSyn, &item, children );
|
||||
}
|
||||
--- poppler-0.67.0/qt4/src/poppler-private.h.orig 2018-08-08 10:13:17.132028085 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-private.h 2018-08-08 11:00:30.836672893 +0200
|
||||
@@ -54,9 +54,9 @@ class FormWidget;
|
||||
namespace Poppler {
|
||||
|
||||
/* borrowed from kpdf */
|
||||
- QString unicodeToQString(Unicode* u, int len);
|
||||
+ QString unicodeToQString(const Unicode* u, int len);
|
||||
|
||||
- QString UnicodeParsedString(GooString *s1);
|
||||
+ QString UnicodeParsedString(const GooString *s1);
|
||||
|
||||
GooString *QStringToUnicodeGooString(const QString &s);
|
||||
|
||||
@@ -69,13 +69,13 @@ namespace Poppler {
|
||||
class LinkDestinationData
|
||||
{
|
||||
public:
|
||||
- LinkDestinationData( LinkDest *l, GooString *nd, Poppler::DocumentData *pdfdoc, bool external )
|
||||
+ LinkDestinationData( const LinkDest *l, const GooString *nd, Poppler::DocumentData *pdfdoc, bool external )
|
||||
: ld(l), namedDest(nd), doc(pdfdoc), externalDest(external)
|
||||
{
|
||||
}
|
||||
|
||||
- LinkDest *ld;
|
||||
- GooString *namedDest;
|
||||
+ const LinkDest *ld;
|
||||
+ const GooString *namedDest;
|
||||
Poppler::DocumentData *doc;
|
||||
bool externalDest;
|
||||
};
|
||||
@@ -115,7 +115,7 @@ namespace Poppler {
|
||||
|
||||
~DocumentData();
|
||||
|
||||
- void addTocChildren( QDomDocument * docSyn, QDomNode * parent, GooList * items );
|
||||
+ void addTocChildren( QDomDocument * docSyn, QDomNode * parent, const GooList * items );
|
||||
|
||||
void setPaperColor(const QColor &color)
|
||||
{
|
||||
--- poppler-0.67.0/qt4/src/poppler-qt4.h.orig 2018-08-08 10:13:17.133028093 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-qt4.h 2018-08-08 10:29:23.807858790 +0200
|
||||
@@ -1816,7 +1816,12 @@ height = dummy.height();
|
||||
/**
|
||||
Conversion from PDF date string format to QDateTime
|
||||
*/
|
||||
- POPPLER_QT4_EXPORT QDateTime convertDate( char *dateString );
|
||||
+ POPPLER_QT4_EXPORT Q_DECL_DEPRECATED QDateTime convertDate( char *dateString );
|
||||
+
|
||||
+ /**
|
||||
+ Conversion from PDF date string format to QDateTime
|
||||
+ */
|
||||
+ POPPLER_QT4_EXPORT QDateTime convertDate( const char *dateString );
|
||||
|
||||
/**
|
||||
Whether the color management functions are available.
|
||||
--- poppler-0.67.0/qt4/src/poppler-sound.cc.orig 2018-08-08 10:13:17.133028093 +0200
|
||||
+++ poppler-0.67.0/qt4/src/poppler-sound.cc 2018-08-08 11:10:31.644004477 +0200
|
||||
@@ -75,7 +75,7 @@ QString SoundObject::url() const
|
||||
if ( m_soundData->m_type != SoundObject::External )
|
||||
return QString();
|
||||
|
||||
- GooString * goo = m_soundData->m_soundObj->getFileName();
|
||||
+ const GooString * goo = m_soundData->m_soundObj->getFileName();
|
||||
return goo ? QString( goo->getCString() ) : QString();
|
||||
}
|
||||
|
||||
BIN
poppler-0.67.0.tar.xz
Normal file
BIN
poppler-0.67.0.tar.xz
Normal file
Binary file not shown.
62
poppler-CVE-2018-19149.patch
Normal file
62
poppler-CVE-2018-19149.patch
Normal file
@ -0,0 +1,62 @@
|
||||
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
|
||||
---
|
||||
diff --git a/glib/poppler-attachment.cc b/glib/poppler-attachment.cc
|
||||
index c6502e9..d12833b 100644
|
||||
--- a/glib/poppler-attachment.cc
|
||||
+++ b/glib/poppler-attachment.cc
|
||||
@@ -111,18 +111,25 @@ _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->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 != NULL && embFile->streamObject()->isStream())
|
||||
+ {
|
||||
+ attachment->size = embFile->size ();
|
||||
|
||||
- if (embFile->checksum () && embFile->checksum ()->getLength () > 0)
|
||||
- attachment->checksum = g_string_new_len (embFile->checksum ()->getCString (),
|
||||
- embFile->checksum ()->getLength ());
|
||||
- priv->obj_stream = embFile->streamObject()->copy();
|
||||
+ 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 = embFile->streamObject()->copy();
|
||||
+ }
|
||||
+ 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 b343eb9..df0aa47 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);
|
||||
}
|
||||
Binary file not shown.
178
poppler.spec
Normal file
178
poppler.spec
Normal file
@ -0,0 +1,178 @@
|
||||
%global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a
|
||||
%global test_date 2009-05-13
|
||||
|
||||
Name: poppler
|
||||
Version: 0.67.0
|
||||
Release: 2
|
||||
Summary: Poppler is a PDF rendering library based on the xpdf-3.0 code base
|
||||
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
|
||||
URL: https://poppler.freedesktop.org/
|
||||
Source0: https://poppler.freedesktop.org/poppler-%{version}.tar.xz
|
||||
Source1: %{name}-test-%{test_date}_%{test_sha}.tar.xz
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1185007
|
||||
Patch0: poppler-0.30.0-rotated-words-selection.patch
|
||||
Patch1: 0001-Revert-Remove-the-Qt4-frontend.patch
|
||||
Patch4: poppler-0.63.0-python3.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1557355
|
||||
Patch6: poppler-0.63.0-tiling-patterns.patch
|
||||
Patch7: poppler-0.67.0-qt4-const.patch
|
||||
|
||||
Patch6000: poppler-CVE-2018-19149.patch
|
||||
Patch6001: poppler_0.26.5_CVE-2019-9200.patch
|
||||
Patch6002: CVE-2018-20662-1.patch
|
||||
Patch6003: CVE-2018-20662-2.patch
|
||||
Patch6004: CVE-2019-9903.patch
|
||||
Patch6005: CVE-2019-9631-1.patch
|
||||
Patch6006: CVE-2019-9631-2.patch
|
||||
Patch6007: CVE-2019-9959.patch
|
||||
|
||||
BuildRequires: cmake gcc-c++ gettext-devel qt5-qtbase-devel qt-devel cairo-devel fontconfig-devel
|
||||
BuildRequires: freetype-devel gdk-pixbuf2-devel glib2-devel gobject-introspection-devel gtk3-devel
|
||||
BuildRequires: gtk-doc lcms2-devel libjpeg-turbo-devel openjpeg2-devel libpng-devel libtiff-devel
|
||||
BuildRequires: nss-devel poppler-data-devel git
|
||||
|
||||
Requires: poppler-data
|
||||
Obsoletes: poppler-glib-demos < 0.60.1-1
|
||||
Provides: poppler-glib poppler-cpp poppler-utils
|
||||
Obsoletes: poppler-glib poppler-cpp poppler-utils
|
||||
|
||||
%description
|
||||
Poppler is a free software utility library for rendering Portable Document Format (PDF) documents. \
|
||||
Its development is supported by freedesktop.org. It is commonly used on Linux systems,and is used by \
|
||||
the PDF viewers of the open source GNOME and KDE desktop environments.
|
||||
|
||||
%package devel
|
||||
Summary: Provide header files and libraries for poppler
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: poppler-glib-devel cpp-devel
|
||||
Provides: poppler-glib-devel cpp-devel
|
||||
|
||||
%description devel
|
||||
The package provides necessary files and documents for the use of compiling applications based on poppler
|
||||
|
||||
%package qt
|
||||
Summary: Provides Qt4 wrapper for poppler
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%{?_qt4:Requires: qt4 >= %{_qt4_version}}
|
||||
Obsoletes: poppler-qt4 < 0.16.0-3
|
||||
Provides: poppler-qt4 = %{version}-%{release}
|
||||
|
||||
%description qt
|
||||
This package provides Qt4 wrapper for poppler.
|
||||
|
||||
%package qt-devel
|
||||
Summary: Provides development files for Qt4 wrapper
|
||||
Requires: %{name}-qt = %{version}-%{release}
|
||||
Requires: %{name}-devel = %{version}-%{release}
|
||||
Obsoletes: poppler-qt4-devel < 0.16.0-3
|
||||
Provides: poppler-qt4-devel = %{version}-%{release}
|
||||
Requires: qt4-devel
|
||||
|
||||
%description qt-devel
|
||||
This package provides development files for Qt4 wrapper.
|
||||
|
||||
%package qt5
|
||||
Summary: Provides Qt5 wrapper for poppler
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description qt5
|
||||
This package provides Qt5 wrapper for poppler.
|
||||
|
||||
%package qt5-devel
|
||||
Summary: Provides development files for Qt5 wrapper
|
||||
Requires: %{name}-qt5 = %{version}-%{release}
|
||||
Requires: %{name}-devel = %{version}-%{release}
|
||||
Requires: qt5-qtbase-devel
|
||||
|
||||
%description qt5-devel
|
||||
This package provides development files for Qt5 wrapper.
|
||||
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -p1 -S git
|
||||
|
||||
%build
|
||||
mkdir build
|
||||
cd build
|
||||
export CC="gcc -fPIC"
|
||||
%cmake \
|
||||
-DENABLE_CMS=lcms2 -DENABLE_DCTDECODER=libjpeg -DENABLE_GTK_DOC=ON \
|
||||
-DENABLE_LIBOPENJPEG=openjpeg2 -DENABLE_XPDF_HEADERS=ON -DENABLE_ZLIB=OFF \
|
||||
..
|
||||
unset CC
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install -C build
|
||||
|
||||
%check
|
||||
%make_build test
|
||||
|
||||
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-qt5)" = "%{version}"
|
||||
test "$(pkg-config --modversion poppler-splash)" = "%{version}"
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
||||
%ldconfig_scriptlets qt
|
||||
|
||||
%ldconfig_scriptlets qt5
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%license COPYING
|
||||
%{_bindir}/pdf*
|
||||
%{_libdir}/libpoppler.so.78*
|
||||
%{_libdir}/libpoppler-glib.so.8*
|
||||
%{_libdir}/libpoppler-cpp.so.0*
|
||||
%{_libdir}/girepository-1.0/Poppler-0.18.typelib
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%dir %{_includedir}/poppler/
|
||||
%{_includedir}/poppler/*.h
|
||||
%{_includedir}/poppler/fofi/
|
||||
%{_includedir}/poppler/goo/
|
||||
%{_includedir}/poppler/splash/
|
||||
%{_includedir}/poppler/glib/
|
||||
%{_includedir}/poppler/cpp
|
||||
%{_libdir}/pkgconfig/poppler.pc
|
||||
%{_libdir}/pkgconfig/poppler-splash.pc
|
||||
%{_libdir}/libpoppler.so
|
||||
%{_libdir}/pkgconfig/poppler-glib.pc
|
||||
%{_libdir}/pkgconfig/poppler-c*.pc
|
||||
%{_libdir}/libpoppler-cpp.so
|
||||
%{_libdir}/libpoppler-glib.so
|
||||
%{_datadir}/gir-1.0/Poppler-0.18.gir
|
||||
|
||||
%files qt
|
||||
%{_libdir}/libpoppler-qt4.so.4*
|
||||
|
||||
%files qt-devel
|
||||
%{_libdir}/libpoppler-qt4.so
|
||||
%{_libdir}/pkgconfig/poppler-qt4.pc
|
||||
%{_includedir}/poppler/qt4/
|
||||
|
||||
%files qt5
|
||||
%{_libdir}/libpoppler-qt5.so.1*
|
||||
|
||||
%files qt5-devel
|
||||
%{_libdir}/libpoppler-qt5.so
|
||||
%{_libdir}/pkgconfig/poppler-qt5.pc
|
||||
%{_includedir}/poppler/qt5/
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
%doc README
|
||||
%{_datadir}/gtk-doc/
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%changelog
|
||||
* Fri Sep 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.67.0-2
|
||||
- Package init
|
||||
13
poppler_0.26.5_CVE-2019-9200.patch
Normal file
13
poppler_0.26.5_CVE-2019-9200.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff -Nur poppler-0.67.0-bak/poppler/Stream.cc poppler-0.67.0/poppler/Stream.cc
|
||||
--- poppler-0.67.0-bak/poppler/Stream.cc 2019-04-17 18:06:23.521000000 +0800
|
||||
+++ poppler-0.67.0/poppler/Stream.cc 2019-04-18 11:40:15.056000000 +0800
|
||||
@@ -504,6 +504,9 @@
|
||||
}
|
||||
|
||||
int readChars = str->doGetChars(inputLineSize, inputLine);
|
||||
+ if (unlikely(readChars == -1)) {
|
||||
+ readChars = 0;
|
||||
+ }
|
||||
for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF;
|
||||
if (nBits == 1) {
|
||||
Guchar *p = inputLine;
|
||||
Loading…
x
Reference in New Issue
Block a user