summaryrefslogtreecommitdiff
path: root/fofi/FoFiTrueType.cc
diff options
context:
space:
mode:
authorBrad Hards <bradh@frogmouth.net>2005-08-27 08:43:42 +0000
committerBrad Hards <bradh@frogmouth.net>2005-08-27 08:43:42 +0000
commitd1d715158223c7ca3ae279cea420a948cfdb0428 (patch)
tree07a14d4aa4ed3b9624826b30e34ac6d2fabe4ab0 /fofi/FoFiTrueType.cc
parentfeb82c60b1f86a9d1260db57534d98c54ee615c4 (diff)
Merge the gmalloc -> gmallocn changes from xpdf 3.0.1. This change is
based on martink's work (13-xpdf-3.01-goo-allocn.patch) with some tweaking by me. There may be some residual gmallocn changes still to be merged.
Diffstat (limited to 'fofi/FoFiTrueType.cc')
-rw-r--r--fofi/FoFiTrueType.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index c73fcf44..2361c012 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -667,7 +667,7 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
missingPost = seekTable("post") < 0;
// read the loca table, check to see if it's sorted
- locaTable = (TrueTypeLoca *)gmalloc((nGlyphs + 1) * sizeof(TrueTypeLoca));
+ locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
unsortedLoca = gFalse;
i = seekTable("loca");
pos = tables[i].offset;
@@ -751,7 +751,7 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
nNewTables = nTables - nZeroLengthTables +
(missingCmap ? 1 : 0) + (missingName ? 1 : 0) +
(missingPost ? 1 : 0);
- newTables = (TrueTypeTable *)gmalloc(nNewTables * sizeof(TrueTypeTable));
+ newTables = (TrueTypeTable *)gmallocn(nNewTables, sizeof(TrueTypeTable));
j = 0;
for (i = 0; i < nTables; ++i) {
if (tables[i].len > 0) {
@@ -1001,7 +1001,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
// table, cmpTrueTypeLocaPos uses offset as its primary sort key,
// and idx as its secondary key (ensuring that adjacent entries with
// the same pos value remain in the same order)
- locaTable = (TrueTypeLoca *)gmalloc((nGlyphs + 1) * sizeof(TrueTypeLoca));
+ locaTable = (TrueTypeLoca *)gmallocn(nGlyphs + 1, sizeof(TrueTypeLoca));
i = seekTable("loca");
pos = tables[i].offset;
ok = gTrue;
@@ -1031,7 +1031,7 @@ void FoFiTrueType::cvtSfnts(FoFiOutputFunc outputFunc,
}
// construct the new 'loca' table
- locaData = (Guchar *)gmalloc((nGlyphs + 1) * (locaFmt ? 4 : 2));
+ locaData = (Guchar *)gmallocn(nGlyphs + 1, (locaFmt ? 4 : 2));
for (i = 0; i <= nGlyphs; ++i) {
pos = locaTable[i].newOffset;
if (locaFmt) {
@@ -1272,7 +1272,7 @@ void FoFiTrueType::parse() {
if (!parsedOk) {
return;
}
- tables = (TrueTypeTable *)gmalloc(nTables * sizeof(TrueTypeTable));
+ tables = (TrueTypeTable *)gmallocn(nTables, sizeof(TrueTypeTable));
pos = 12;
for (i = 0; i < nTables; ++i) {
tables[i].tag = getU32BE(pos, &parsedOk);
@@ -1309,7 +1309,7 @@ void FoFiTrueType::parse() {
if (!parsedOk) {
return;
}
- cmaps = (TrueTypeCmap *)gmalloc(nCmaps * sizeof(TrueTypeCmap));
+ cmaps = (TrueTypeCmap *)gmallocn(nCmaps, sizeof(TrueTypeCmap));
for (j = 0; j < nCmaps; ++j) {
cmaps[j].platform = getU16BE(pos, &parsedOk);
cmaps[j].encoding = getU16BE(pos + 2, &parsedOk);