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];
}
action = LinkAction::parseDest(&obj1);
} else {
obj1.free();
- if (dict->lookup("A", &obj1)) {
+ if (!dict->lookup("A", &obj1)->isNull()) {
action = LinkAction::parseAction(&obj1);
}
}