X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FOutline.cc;h=39e89a3c3fb9612fcb81cd32c85a6598587779dd;hp=04891f3c309e7ea06b2f311989e4d78c504a05e7;hb=85c46a8011c7fd5e4bda282266006c972ea7606b;hpb=b0d012f83219d898e9cd92281d9996bc9ff13b5f diff --git a/pdf2swf/xpdf/Outline.cc b/pdf2swf/xpdf/Outline.cc index 04891f3..39e89a3 100644 --- a/pdf2swf/xpdf/Outline.cc +++ b/pdf2swf/xpdf/Outline.cc @@ -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); } }