summaryrefslogtreecommitdiffstats
path: root/modules/freetype2/src/base/ftutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/freetype2/src/base/ftutil.c')
-rw-r--r--modules/freetype2/src/base/ftutil.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/freetype2/src/base/ftutil.c b/modules/freetype2/src/base/ftutil.c
index 36d2dd721..4de5f2c14 100644
--- a/modules/freetype2/src/base/ftutil.c
+++ b/modules/freetype2/src/base/ftutil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType utility file for memory and list management (body). */
/* */
-/* Copyright 2002-2016 by */
+/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -135,7 +135,7 @@
ft_mem_free( memory, block );
block = NULL;
}
- else if ( new_count > FT_INT_MAX/item_size )
+ else if ( new_count > FT_INT_MAX / item_size )
{
error = FT_THROW( Array_Too_Large );
}
@@ -143,13 +143,15 @@
{
FT_ASSERT( !block );
- block = ft_mem_alloc( memory, new_count*item_size, &error );
+ block = memory->alloc( memory, new_count * item_size );
+ if ( block == NULL )
+ error = FT_THROW( Out_Of_Memory );
}
else
{
FT_Pointer block2;
- FT_Long cur_size = cur_count*item_size;
- FT_Long new_size = new_count*item_size;
+ FT_Long cur_size = cur_count * item_size;
+ FT_Long new_size = new_count * item_size;
block2 = memory->realloc( memory, cur_size, new_size, block );