summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2013-10-10 02:16:25 +0200
committerAlbert Astals Cid <aacid@kde.org>2013-10-10 02:18:28 +0200
commitdaa0990a7baf17d00d12574a4de815e070727a86 (patch)
tree45eb723d4fed667b8e403cb62fac19e93e7e24bd
parentf4bfa940aa40a82a1080cdaf765da1d1615ccfb1 (diff)
Return empty if getXRef()->copy() fails
Seems this can happen by looking at the backtrace in https://bugs.kde.org/show_bug.cgi?id=325810
-rw-r--r--qt4/src/poppler-document.cc6
-rw-r--r--qt5/src/poppler-document.cc6
2 files changed, 12 insertions, 0 deletions
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index 7d13656d..6a06ab8d 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -269,6 +269,8 @@ namespace Poppler {
return QString();
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QString();
xref->getDocInfo(&info);
if ( !info.isDict() )
return QString();
@@ -300,6 +302,8 @@ namespace Poppler {
return QStringList();
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QStringList();
xref->getDocInfo(&info);
if ( !info.isDict() )
return QStringList();
@@ -323,6 +327,8 @@ namespace Poppler {
Object info;
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QDateTime();
xref->getDocInfo(&info);
if ( !info.isDict() ) {
info.free();
diff --git a/qt5/src/poppler-document.cc b/qt5/src/poppler-document.cc
index af1804ee..158d506c 100644
--- a/qt5/src/poppler-document.cc
+++ b/qt5/src/poppler-document.cc
@@ -255,6 +255,8 @@ namespace Poppler {
return QString();
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QString();
xref->getDocInfo(&info);
if ( !info.isDict() )
return QString();
@@ -286,6 +288,8 @@ namespace Poppler {
return QStringList();
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QStringList();
xref->getDocInfo(&info);
if ( !info.isDict() )
return QStringList();
@@ -309,6 +313,8 @@ namespace Poppler {
Object info;
QScopedPointer<XRef> xref(m_doc->doc->getXRef()->copy());
+ if (!xref)
+ return QDateTime();
xref->getDocInfo(&info);
if ( !info.isDict() ) {
info.free();