X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FOutline.cc;h=39e89a3c3fb9612fcb81cd32c85a6598587779dd;hb=c26ca847941ca0acfc9f3b4bdc519d904ba09a39;hp=04891f3c309e7ea06b2f311989e4d78c504a05e7;hpb=c7432833fe3a6469d63fad135151a92e12877b94;p=swftools.git 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); } }