summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Aliste <jose.aliste@gmail.com>2019-06-25 21:32:24 -0400
committerJosé Aliste <jose.aliste@gmail.com>2019-06-25 21:32:24 -0400
commita24536c619a463763517401045eaf251190c7db0 (patch)
tree74dda7e64a1deb99917fc23e97b085f72a60a091
parenta4d3db87c3bae5e2a364c828479a6cbb0277069e (diff)
Handle Ink annots without an InkList but with an AP
According to the pdf spec, the AP entry should take precedence over the InkList entry. Thus, it is safe to render Ink annots with an AP entry but missing an InkList entry. This fixes rendering of some Onyx Generated files.
-rw-r--r--poppler/Annot.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 8a0c261d..18357a9c 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -5833,8 +5833,14 @@ void AnnotInk::initialize(PDFDoc *docA, Dict* dict) {
} else {
inkListLength = 0;
inkList = nullptr;
- error(errSyntaxError, -1, "Bad Annot Ink List");
- ok = false;
+ obj1 = dict->lookup("AP");
+
+ // Although InkList is required, it should be ignored
+ // when there is an AP entry in the Annot.
+ if (!obj1.isDict()) {
+ error(errSyntaxError, -1, "Bad Annot Ink List");
+ ok = false;
+ }
}
obj1 = dict->lookup("BS");