[poppler] Branch 'poppler-0.14' - 2 commits - glib/poppler-layer.cc poppler/PDFDoc.cc
Carlos Garcia Campos
carlosgc at kemper.freedesktop.org
Tue Aug 3 04:07:11 PDT 2010
glib/poppler-layer.cc | 4 +++-
poppler/PDFDoc.cc | 27 +++++++++++++++------------
2 files changed, 18 insertions(+), 13 deletions(-)
New commits:
commit 74c5d08a5920c4819c5996257568051dedcdb33c
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Tue Aug 3 13:05:26 2010 +0200
[glib] Fix a crash when a layer doesn't have a name
Fixes bug #28842.
diff --git a/glib/poppler-layer.cc b/glib/poppler-layer.cc
index 43aa85a..329ca90 100644
--- a/glib/poppler-layer.cc
+++ b/glib/poppler-layer.cc
@@ -69,6 +69,7 @@ _poppler_layer_new (PopplerDocument *document,
GList *rbgroup)
{
PopplerLayer *poppler_layer;
+ GooString *layer_name;
g_return_val_if_fail (POPPLER_IS_DOCUMENT (document), NULL);
g_return_val_if_fail (layer != NULL, NULL);
@@ -78,7 +79,8 @@ _poppler_layer_new (PopplerDocument *document,
poppler_layer->document = (PopplerDocument *)g_object_ref (document);
poppler_layer->layer = layer;
poppler_layer->rbgroup = rbgroup;
- poppler_layer->title = _poppler_goo_string_to_utf8 (layer->oc->getName ());
+ layer_name = layer->oc->getName ();
+ poppler_layer->title = layer_name ? _poppler_goo_string_to_utf8 (layer_name) : NULL;
return poppler_layer;
}
commit 7492c94060917df4311441e97b987e7e2bcdfb3f
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date: Tue Aug 3 13:02:52 2010 +0200
Catalog page array might contain NULL for some pages in invalid documents
Fixes a crash reproducible with gtk-splash-test when opening document
attached to bug #28842.
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index ade5fe4..33a2b4d 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -368,10 +368,11 @@ void PDFDoc::displayPage(OutputDev *out, int page,
if (globalParams->getPrintCommands()) {
printf("***** page %d *****\n", page);
}
- catalog->getPage(page)->display(out, hDPI, vDPI,
- rotate, useMediaBox, crop, printing, catalog,
- abortCheckCbk, abortCheckCbkData,
- annotDisplayDecideCbk, annotDisplayDecideCbkData);
+ if (catalog->getPage(page))
+ catalog->getPage(page)->display(out, hDPI, vDPI,
+ rotate, useMediaBox, crop, printing, catalog,
+ abortCheckCbk, abortCheckCbkData,
+ annotDisplayDecideCbk, annotDisplayDecideCbkData);
}
void PDFDoc::displayPages(OutputDev *out, int firstPage, int lastPage,
@@ -398,20 +399,22 @@ void PDFDoc::displayPageSlice(OutputDev *out, int page,
void *abortCheckCbkData,
GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
void *annotDisplayDecideCbkData) {
- catalog->getPage(page)->displaySlice(out, hDPI, vDPI,
- rotate, useMediaBox, crop,
- sliceX, sliceY, sliceW, sliceH,
- printing, catalog,
- abortCheckCbk, abortCheckCbkData,
- annotDisplayDecideCbk, annotDisplayDecideCbkData);
+ if (catalog->getPage(page))
+ catalog->getPage(page)->displaySlice(out, hDPI, vDPI,
+ rotate, useMediaBox, crop,
+ sliceX, sliceY, sliceW, sliceH,
+ printing, catalog,
+ abortCheckCbk, abortCheckCbkData,
+ annotDisplayDecideCbk, annotDisplayDecideCbkData);
}
Links *PDFDoc::getLinks(int page) {
- return catalog->getPage(page)->getLinks(catalog);
+ return catalog->getPage(page) ? catalog->getPage(page)->getLinks(catalog) : NULL;
}
void PDFDoc::processLinks(OutputDev *out, int page) {
- catalog->getPage(page)->processLinks(out, catalog);
+ if (catalog->getPage(page))
+ catalog->getPage(page)->processLinks(out, catalog);
}
GBool PDFDoc::isLinearized() {
More information about the poppler
mailing list