diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c index de7d0fdd5b6..788a37b3171 100644 --- a/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c +++ b/Build/source/libs/freetype2/freetype-src/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ * parse compressed PCF fonts, as found with many X11 server * distributions. * - * Copyright (C) 2002-2020 by + * Copyright (C) 2002-2021 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -121,24 +121,29 @@ 'malloc/free' */ static voidpf - ft_gzip_alloc( FT_Memory memory, - uInt items, - uInt size ) + ft_gzip_alloc( voidpf opaque, + uInt items, + uInt size ) { - FT_ULong sz = (FT_ULong)size * items; + FT_Memory memory = (FT_Memory)opaque; + FT_ULong sz = (FT_ULong)size * items; FT_Error error; - FT_Pointer p = NULL; + FT_Pointer p = NULL; + /* allocate and zero out */ (void)FT_ALLOC( p, sz ); return p; } static void - ft_gzip_free( FT_Memory memory, - voidpf address ) + ft_gzip_free( voidpf opaque, + voidpf address ) { + FT_Memory memory = (FT_Memory)opaque; + + FT_MEM_FREE( address ); } @@ -150,14 +155,14 @@ unsigned items, unsigned size ) { - return ft_gzip_alloc( (FT_Memory)opaque, items, size ); + return ft_gzip_alloc( opaque, items, size ); } local void zcfree( voidpf opaque, voidpf ptr ) { - ft_gzip_free( (FT_Memory)opaque, ptr ); + ft_gzip_free( opaque, ptr ); } #endif /* !SYSTEM_ZLIB && !USE_ZLIB_ZCALLOC */ @@ -304,8 +309,8 @@ } /* initialize zlib -- there is no zlib header in the compressed stream */ - zstream->zalloc = (alloc_func)ft_gzip_alloc; - zstream->zfree = (free_func) ft_gzip_free; + zstream->zalloc = ft_gzip_alloc; + zstream->zfree = ft_gzip_free; zstream->opaque = stream->memory; zstream->avail_in = 0; @@ -671,7 +676,7 @@ FT_Byte* zip_buff = NULL; - if ( !FT_ALLOC( zip_buff, zip_size ) ) + if ( !FT_QALLOC( zip_buff, zip_size ) ) { FT_ULong count; @@ -741,8 +746,8 @@ stream.next_out = output; stream.avail_out = (uInt)*output_len; - stream.zalloc = (alloc_func)ft_gzip_alloc; - stream.zfree = (free_func) ft_gzip_free; + stream.zalloc = ft_gzip_alloc; + stream.zfree = ft_gzip_free; stream.opaque = memory; /* This is a temporary fix and will be removed once the internal |