forked from minhngoc25a/freetype2
[woff] Don't allocate table entries until needed
* src/sfnt/sfwoff.c (woff_open_font): delay allocating space for the table entries until they are actually written out with the data.
This commit is contained in:
parent
8b6bcc92c5
commit
58395dd200
|
@ -162,8 +162,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't trust `totalSfntSize' before thorough checks. */
|
/* Don't trust `totalSfntSize' before thorough checks. */
|
||||||
if ( FT_QALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
|
if ( FT_QALLOC( sfnt, 12 ) || FT_NEW( sfnt_stream ) )
|
||||||
FT_NEW( sfnt_stream ) )
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
sfnt_header = sfnt;
|
sfnt_header = sfnt;
|
||||||
|
@ -328,9 +327,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now use `totalSfntSize'. */
|
/* Now use `totalSfntSize'. */
|
||||||
if ( FT_QREALLOC( sfnt,
|
if ( FT_QREALLOC( sfnt, 12, woff.totalSfntSize ) )
|
||||||
12 + woff.num_tables * 16UL,
|
|
||||||
woff.totalSfntSize ) )
|
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
sfnt_header = sfnt + 12;
|
sfnt_header = sfnt + 12;
|
||||||
|
|
Loading…
Reference in New Issue