summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2013-06-26 23:12:40 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2013-06-27 09:13:41 +0200
commit2639957ba78defd2ab6282679375fb7969bad21f (patch)
tree8b328ec3bc8edff15991f5e766fb7e073aa62aa8
parentae016aa263c218fbfbd607cc92feac1013348c7e (diff)
Do not crash in page::removeAnnot if there are non-Ref entries in /Annots
-rw-r--r--poppler/Page.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/poppler/Page.cc b/poppler/Page.cc
index a587b9ba..426a15d5 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -454,11 +454,13 @@ void Page::removeAnnot(Annot *annot) {
// Get annotation position
for (int i = 0; idx == -1 && i < annArray.arrayGetLength(); ++i) {
Object tmp;
- Ref currAnnot = annArray.arrayGetNF(i, &tmp)->getRef();
- tmp.free();
- if (currAnnot.num == annotRef.num && currAnnot.gen == annotRef.gen) {
- idx = i;
+ if (annArray.arrayGetNF(i, &tmp)->isRef()) {
+ Ref currAnnot = tmp.getRef();
+ if (currAnnot.num == annotRef.num && currAnnot.gen == annotRef.gen) {
+ idx = i;
+ }
}
+ tmp.free();
}
if (idx == -1) {