[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Wed Feb 11 10:41:09 PST 2015


 poppler/Annot.cc |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 132ef18324f62c1f2a08dcd794b379fadaa4daf5
Author: Petr Gajdos <pgajdos at suse.cz>
Date:   Wed Feb 11 19:37:21 2015 +0100

    Annot BG/BC: Empty Array means no color

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index d35cb9b..d7769a0 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -32,6 +32,7 @@
 // Copyright (C) 2014 Marek Kasik <mkasik at redhat.com>
 // Copyright (C) 2014 Jiri Slaby <jirislaby at gmail.com>
 // Copyright (C) 2014 Anuj Khare <khareanuj18 at gmail.com>
+// Copyright (C) 2015 Petr Gajdos <pgajdos at suse.cz>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -1045,14 +1046,24 @@ AnnotAppearanceCharacs::AnnotAppearanceCharacs(Dict *dict) {
   obj1.free();
 
   if (dict->lookup("BC", &obj1)->isArray()) {
-    borderColor = new AnnotColor(obj1.getArray());
+    Array *colorComponents = obj1.getArray();
+    if (colorComponents->getLength() > 0) {
+      borderColor = new AnnotColor(colorComponents);
+    } else {
+      borderColor = NULL;
+    }
   } else {
     borderColor = NULL;
   }
   obj1.free();
 
   if (dict->lookup("BG", &obj1)->isArray()) {
-    backColor = new AnnotColor(obj1.getArray());
+    Array *colorComponents = obj1.getArray();
+    if (colorComponents->getLength() > 0) {
+      backColor = new AnnotColor(colorComponents);
+    } else {
+      backColor = NULL;
+    }
   } else {
     backColor = NULL;
   }


More information about the poppler mailing list