diff options
author | Albert Astals Cid <aacid@kde.org> | 2017-09-02 11:31:51 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2017-09-02 11:31:51 +0200 |
commit | ea6174def73f7478ae76843bb88ef85c5a6150f9 (patch) | |
tree | 102d7be7abc027d1347d8cf09104c3637a5b3d37 /utils/pdfinfo.cc | |
parent | 73e12716f3e4643c2ea13421902b8220596454d7 (diff) |
pdfinfo: Fix crash if getDest* returns nullptr
Diffstat (limited to 'utils/pdfinfo.cc')
-rw-r--r-- | utils/pdfinfo.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc index f9fde5a3..07733128 100644 --- a/utils/pdfinfo.cc +++ b/utils/pdfinfo.cc @@ -380,7 +380,7 @@ static void printDestinations(PDFDoc *doc, UnicodeMap *uMap) { for (int i = 0; i < numDests; i++) { GooString *name = doc->getCatalog()->getDestNameTreeName(i); LinkDest *dest = doc->getCatalog()->getDestNameTreeDest(i); - if (dest->isPageRef()) { + if (dest && dest->isPageRef()) { map[dest->getPageRef()].insert(std::make_pair(name, dest)); } } @@ -389,7 +389,7 @@ static void printDestinations(PDFDoc *doc, UnicodeMap *uMap) { for (int i = 0; i < numDests; i++) { GooString *name = new GooString(doc->getCatalog()->getDestsName(i)); LinkDest *dest = doc->getCatalog()->getDestsDest(i); - if (dest->isPageRef()) { + if (dest && dest->isPageRef()) { map[dest->getPageRef()].insert(std::make_pair(name, dest)); } } |