upgraded to xpdf-3.01pl1
[swftools.git] / pdf2swf / xpdf / Outline.cc
index 04891f3..39e89a3 100644 (file)
@@ -58,14 +58,14 @@ OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
     if ((s->getChar(0) & 0xff) == 0xfe &&
        (s->getChar(1) & 0xff) == 0xff) {
       titleLen = (s->getLength() - 2) / 2;
-      title = (Unicode *)gmalloc(titleLen * sizeof(Unicode));
+      title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
       for (i = 0; i < titleLen; ++i) {
        title[i] = ((s->getChar(2 + 2*i) & 0xff) << 8) |
                   (s->getChar(3 + 2*i) & 0xff);
       }
     } else {
       titleLen = s->getLength();
-      title = (Unicode *)gmalloc(titleLen * sizeof(Unicode));
+      title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
       for (i = 0; i < titleLen; ++i) {
        title[i] = pdfDocEncoding[s->getChar(i) & 0xff];
       }
@@ -79,7 +79,7 @@ OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
     action = LinkAction::parseDest(&obj1);
   } else {
     obj1.free();
-    if (dict->lookup("A", &obj1)) {
+    if (!dict->lookup("A", &obj1)->isNull()) {
       action = LinkAction::parseAction(&obj1);
     }
   }