Commit 00457c5f authored by Marco Pesenti Gritti's avatar Marco Pesenti Gritti

2005-09-16 Marco Pesenti Gritti <mpg@redhat.com>

        * poppler/ArthurOutputDev.cc:
        * poppler/CairoFontEngine.cc:
        * poppler/TextOutputDev.cc:
        * poppler/UnicodeMap.cc:

        Use mallocn when possible
parent 09c9ff67
2005-09-16 Marco Pesenti Gritti <mpg@redhat.com>
* poppler/ArthurOutputDev.cc:
* poppler/CairoFontEngine.cc:
* poppler/TextOutputDev.cc:
* poppler/UnicodeMap.cc:
Use mallocn when possible
2005-09-16 Albert Astals Cid <aacid@kde.org>
* splash/: Some merges from xpdf 3.01
......
......@@ -378,7 +378,7 @@ void ArthurOutputDev::updateFont(GfxState *state)
break;
case fontCIDType2:
n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
n * sizeof(Gushort));
if (!(fontFile = m_fontEngine->loadTrueTypeFont(
......
......@@ -112,7 +112,7 @@ CairoFont::CairoFont(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs
enc = ((Gfx8BitFont *)gfxFont)->getEncoding();
codeToGID = (Gushort *)gmalloc(256 * sizeof(int));
codeToGID = (Gushort *)gmallocn(256, sizeof(int));
codeToGIDLen = 256;
for (i = 0; i < 256; ++i) {
codeToGID[i] = 0;
......@@ -125,7 +125,7 @@ CairoFont::CairoFont(GfxFont *gfxFont, XRef *xref, FT_Library lib, GBool useCIDs
case fontCIDType2:
n = ((GfxCIDFont *)gfxFont)->getCIDToGIDLen();
codeToGIDLen = n;
codeToGID = (Gushort *)gmalloc(n * sizeof(Gushort));
codeToGID = (Gushort *)gmallocn(n, sizeof(Gushort));
memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
n * sizeof(Gushort));
/* Fall through */
......
......@@ -3036,7 +3036,7 @@ TextSelectionDumper::TextSelectionDumper(TextPage *page)
: TextSelectionVisitor(page)
{
fragsSize = 256;
frags = (TextLineFrag *)gmalloc(fragsSize * sizeof(TextLineFrag));
frags = (TextLineFrag *)gmallocn(fragsSize, sizeof(TextLineFrag));
nFrags = 0;
}
......
......@@ -53,7 +53,7 @@ UnicodeMap *UnicodeMap::parse(GooString *encodingNameA) {
map = new UnicodeMap(encodingNameA->copy());
size = 8;
map->ranges = (UnicodeMapRange *)gmalloc(size * sizeof(UnicodeMapRange));
map->ranges = (UnicodeMapRange *)gmallocn(size, sizeof(UnicodeMapRange));
eMapsSize = 0;
line = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment