[poppler] 4 commits - poppler/DCTStream.cc poppler/PDFDoc.cc qt4/tests splash/Splash.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Jul 19 15:25:16 PDT 2011
poppler/DCTStream.cc | 6 +++---
poppler/PDFDoc.cc | 2 +-
qt4/tests/test-poppler-qt4.cpp | 7 +++++--
splash/Splash.cc | 13 +++++++++++++
4 files changed, 22 insertions(+), 6 deletions(-)
New commits:
commit ce97cfcd6373c98fb8c63e9b3ef6c51738f22a50
Author: Albert Astals Cid <aacid at kde.org>
Date: Wed Jul 20 00:24:52 2011 +0200
Render dots for 0 length dashed lines
Bug 34150
diff --git a/splash/Splash.cc b/splash/Splash.cc
index 74f523c..cfc6ba2 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -1552,6 +1552,19 @@ SplashPath *Splash::makeDashedPath(SplashPath *path) {
}
i = j + 1;
}
+
+ if (dPath->length == 0) {
+ GBool allSame = gTrue;
+ for (int i = 0; allSame && i < path->length - 1; ++i) {
+ allSame = path->pts[i].x == path->pts[i + 1].x && path->pts[i].y == path->pts[i + 1].y;
+ }
+ if (allSame) {
+ x0 = path->pts[0].x;
+ y0 = path->pts[0].y;
+ dPath->moveTo(x0, y0);
+ dPath->lineTo(x0, y0);
+ }
+ }
return dPath;
}
commit 42c1b1c4af6b07f488d1b2b02a4700f19b0ab0ef
Author: Tomas Hoger <thoger at redhat.com>
Date: Wed Jul 20 00:23:15 2011 +0200
Fix crash on truncated JPEG/DCT stream
Bug 36693
diff --git a/poppler/DCTStream.cc b/poppler/DCTStream.cc
index 78cd59d..c0ef81d 100644
--- a/poppler/DCTStream.cc
+++ b/poppler/DCTStream.cc
@@ -9,6 +9,7 @@
// Copyright 2009 Ryszard Trojnacki <rysiek at menel.com>
// Copyright 2010 Carlos Garcia Campos <carlosgc at gnome.org>
// Copyright 2011 Daiki Ueno <ueno at unixuser.org>
+// Copyright 2011 Tomas Hoger <thoger at redhat.com>
//
//========================================================================
@@ -141,9 +142,8 @@ void DCTStream::reset() {
}
}
- if (!setjmp(err.setjmp_buffer)) {
- jpeg_read_header(&cinfo, TRUE);
-
+ if (!setjmp(err.setjmp_buffer) && jpeg_read_header(&cinfo, TRUE) != JPEG_SUSPENDED)
+ {
// figure out color transform
if (colorXform == -1 && !cinfo.saw_Adobe_marker) {
if (cinfo.num_components == 3) {
commit 091b570c63694e475c24bb8805638ac70c654892
Author: Albert Astals Cid <aacid at kde.org>
Date: Wed Jul 20 00:19:43 2011 +0200
Make sure the dict is a page dict
Fixes second part of 35925 and 39072
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index cb16cf8..58356e6 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -1169,7 +1169,7 @@ Page *PDFDoc::parsePage(int page)
pageRef.gen = xref->getEntry(pageRef.num)->gen;
xref->fetch(pageRef.num, pageRef.gen, &obj);
- if (!obj.isDict()) {
+ if (!obj.isDict("Page")) {
obj.free();
error(-1, "Object (%d %d) is not a pageDict", pageRef.num, pageRef.gen);
return NULL;
commit ac566c887ffae9d384587f7587609642aef7a016
Author: Albert Astals Cid <aacid at kde.org>
Date: Wed Jul 20 00:17:49 2011 +0200
Do not crash if can not get page 0 for some reason
diff --git a/qt4/tests/test-poppler-qt4.cpp b/qt4/tests/test-poppler-qt4.cpp
index 2f0f924..503b35a 100644
--- a/qt4/tests/test-poppler-qt4.cpp
+++ b/qt4/tests/test-poppler-qt4.cpp
@@ -209,8 +209,11 @@ int main( int argc, char **argv )
}
Poppler::Page *page = doc->page(0);
- qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
- delete page;
+ if (page)
+ {
+ qDebug() << "Page 1 size: " << page->pageSize().width()/72 << "inches x " << page->pageSize().height()/72 << "inches";
+ delete page;
+ }
if (argc == 2 || (argc == 3 && strcmp(argv[2], "-arthur") == 0) || (argc == 3 && strcmp(argv[2], "-textRects") == 0))
{
More information about the poppler
mailing list