[cff] Fix memory initialization.

* src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'.  The `Q'
variants of FreeType's memory allocation macros don't do zeroing.
This commit is contained in:
Werner Lemberg 2016-09-05 10:55:07 +02:00
parent 1c8bb63299
commit 3ebfe3c545
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2016-09-05 Werner Lemberg <wl@gnu.org>
[cff] Fix memory initialization.
* src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'. The `Q'
variants of FreeType's memory allocation macros don't do zeroing.
2016-09-05 Werner Lemberg <wl@gnu.org>
[ftrandom] Minor improvements.

View File

@ -53,14 +53,14 @@
cf2_stack_init( FT_Memory memory,
FT_Error* e )
{
FT_Error error = FT_Err_Ok; /* for FT_QNEW */
FT_Error error = FT_Err_Ok; /* for FT_NEW */
CF2_Stack stack = NULL;
if ( !FT_QNEW( stack ) )
if ( !FT_NEW( stack ) )
{
/* initialize the structure; FT_QNEW zeroes it */
/* initialize the structure; FT_NEW zeroes it */
stack->memory = memory;
stack->error = e;
stack->top = &stack->buffer[0]; /* empty stack */