From 9d475e87784e67a24d8a362288fb94a4037aa9b7 Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Sun, 24 Jun 2012 11:48:04 +0200 Subject: [PATCH] qt4: Do not hang on malformed /Annots objects Don't recurse infinitely if the /Annots object contains annotation dictionaries (according to specs, /Annots must contain *references* to annotation dictionaries). --- qt4/src/poppler-annotation.cc | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/qt4/src/poppler-annotation.cc b/qt4/src/poppler-annotation.cc index f6341b0..d4f12d4 100644 --- a/qt4/src/poppler-annotation.cc +++ b/qt4/src/poppler-annotation.cc @@ -1504,6 +1504,11 @@ QList Annotation::revisions() const return res; } + /* If the annotation doesn't live in a object on its own (eg bug51361), it + * has no ref, therefore it can't have revisions */ + if ( !d->pdfAnnot->getHasRef() ) + return QList(); + return AnnotationPrivate::findAnnotations( d->pdfPage, d->parentDoc, d->pdfAnnot->getId() ); } -- 1.7.6.5