Navigation Menu

Skip to content

Commit

Permalink
Fix glyphs table parsing on big endian host
Browse files Browse the repository at this point in the history
  • Loading branch information
Shigeharu TAKENO authored and Sandro Santilli committed Oct 28, 2011
1 parent 4fae575 commit f73c62e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/parser.c
Expand Up @@ -242,6 +242,7 @@ parseSWF_GLYPHENTRY (FILE * f, SWF_GLYPHENTRY *gerec, int glyphbits, int advance
int i;

gerec->GlyphIndex = malloc((glyphbits+31)/32 * sizeof(UI32) );
gerec->GlyphIndex[0] = 0; /* for glyphbits == 0 */
for( i=0; glyphbits; i++ ) {
if( glyphbits > 32 ) {
gerec->GlyphIndex[i] = readBits(f, 32);
Expand All @@ -253,6 +254,7 @@ parseSWF_GLYPHENTRY (FILE * f, SWF_GLYPHENTRY *gerec, int glyphbits, int advance
}

gerec->GlyphAdvance = malloc((advancebits+31)/32 * sizeof(UI32) );
gerec->GlyphAdvance[0] = 0; /* for advancebits == 0 */
for( i=0; advancebits; i++ ) {
if( advancebits > 32 ) {
gerec->GlyphAdvance[i] = readBits(f, 32);
Expand Down

0 comments on commit f73c62e

Please sign in to comment.