* poppler/Page.cc: Consider 0x0 boxes as invalid. Fixes
http://bugzilla.gnome.org/show_bug.cgi?id=408682
diff --git a/ChangeLog b/ChangeLog
index 416e573..636f8ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-07 Carlos Garcia Campos <carlosgc@gnome.org>
+ reviewed by: Albert Astals Cid <aacid@kde.org>
+
+ * poppler/Page.cc: Consider 0x0 boxes as invalid. Fixes
+ http://bugzilla.gnome.org/show_bug.cgi?id=408682
+
2007-02-24 Albert Astals Cid <aacid@kde.org>
* configure.ac: Change {datadir}/poppler to {datarootdir}/poppler so
that i get /usr/local/share/poppler in config.h instead of
diff --git a/poppler/Page.cc b/poppler/Page.cc
index c88d462..4563a74 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -37,6 +37,7 @@
PageAttrs::PageAttrs(PageAttrs *attrs, Dict *dict) {
Object obj1;
+ PDFRectangle mBox;
// get old/default values
if (attrs) {
@@ -59,7 +60,9 @@
}
// media box
- readBox(dict, "MediaBox", &mediaBox);
+ if (readBox(dict, "MediaBox", &mBox)) {
+ mediaBox = mBox;
+ }
// crop box
if (readBox(dict, "CropBox", &cropBox)) {
@@ -168,6 +171,8 @@
ok = gFalse;
}
obj2.free();
+ if (tmp.x1 == 0 && tmp.x2 == 0 && tmp.y1 == 0 && tmp.y2 == 0)
+ ok = gFalse;
if (ok) {
if (tmp.x1 > tmp.x2) {
t = tmp.x1; tmp.x1 = tmp.x2; tmp.x2 = t;