summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c57
1 files changed, 17 insertions, 40 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c
index df04072382e..5c8202f8237 100644
--- a/Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c
+++ b/Build/source/libs/freetype2/freetype-src/src/sfnt/sfwoff2.c
@@ -4,7 +4,7 @@
*
* WOFF2 format management (base).
*
- * Copyright (C) 2019-2021 by
+ * Copyright (C) 2019-2020 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -101,7 +101,7 @@
}
- FT_COMPARE_DEF( int )
+ FT_CALLBACK_DEF( int )
compare_tags( const void* a,
const void* b )
{
@@ -341,11 +341,6 @@
#else /* !FT_CONFIG_OPTION_USE_BROTLI */
- FT_UNUSED( dst );
- FT_UNUSED( dst_size );
- FT_UNUSED( src );
- FT_UNUSED( src_size );
-
FT_ERROR(( "woff2_decompress: Brotli support not available.\n" ));
return FT_THROW( Unimplemented_Feature );
@@ -795,7 +790,7 @@
goto Fail;
loca_buf_size = loca_values_size * offset_size;
- if ( FT_QNEW_ARRAY( loca_buf, loca_buf_size ) )
+ if ( FT_NEW_ARRAY( loca_buf, loca_buf_size ) )
goto Fail;
dst = loca_buf;
@@ -1857,10 +1852,11 @@
FT_NEW_ARRAY( indices, woff2.num_tables ) )
goto Exit;
- FT_TRACE2(( "\n" ));
- FT_TRACE2(( " tag flags transform origLen transformLen offset\n" ));
- FT_TRACE2(( " -----------------------------------------------------------\n" ));
- /* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
+ FT_TRACE2((
+ "\n"
+ " tag flags transform origLen transformLen offset\n"
+ " -----------------------------------------------------------\n" ));
+ /* " XXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" */
for ( nn = 0; nn < woff2.num_tables; nn++ )
{
@@ -2123,8 +2119,8 @@
/* Create a temporary array. */
- if ( FT_QNEW_ARRAY( temp_indices,
- ttc_font->num_tables ) )
+ if ( FT_NEW_ARRAY( temp_indices,
+ ttc_font->num_tables ) )
goto Exit;
FT_TRACE4(( "Storing tables for TTC face index %d.\n", face_index ));
@@ -2132,9 +2128,9 @@
temp_indices[nn] = indices[ttc_font->table_indices[nn]];
/* Resize array to required size. */
- if ( FT_QRENEW_ARRAY( indices,
- woff2.num_tables,
- ttc_font->num_tables ) )
+ if ( FT_RENEW_ARRAY( indices,
+ woff2.num_tables,
+ ttc_font->num_tables ) )
goto Exit;
for ( nn = 0; nn < ttc_font->num_tables; nn++ )
@@ -2174,8 +2170,8 @@
}
/* Write sfnt header. */
- if ( FT_QALLOC( sfnt, sfnt_size ) ||
- FT_NEW( sfnt_stream ) )
+ if ( FT_ALLOC( sfnt, sfnt_size ) ||
+ FT_NEW( sfnt_stream ) )
goto Exit;
sfnt_header = sfnt;
@@ -2213,25 +2209,6 @@
sizeof ( WOFF2_Table ),
compare_tags );
- /* reject fonts that have multiple tables with the same tag */
- for ( nn = 1; nn < woff2.num_tables; nn++ )
- {
- FT_ULong tag = indices[nn]->Tag;
-
-
- if ( tag == indices[nn - 1]->Tag )
- {
- FT_ERROR(( "woff2_open_font:"
- " multiple tables with tag `%c%c%c%c'.\n",
- (FT_Char)( tag >> 24 ),
- (FT_Char)( tag >> 16 ),
- (FT_Char)( tag >> 8 ),
- (FT_Char)( tag ) ));
- error = FT_THROW( Invalid_Table );
- goto Exit;
- }
- }
-
if ( woff2.uncompressed_size < 1 )
{
error = FT_THROW( Invalid_Table );
@@ -2246,8 +2223,8 @@
}
/* Allocate memory for uncompressed table data. */
- if ( FT_QALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
- FT_FRAME_ENTER( woff2.totalCompressedSize ) )
+ if ( FT_ALLOC( uncompressed_buf, woff2.uncompressed_size ) ||
+ FT_FRAME_ENTER( woff2.totalCompressedSize ) )
goto Exit;
/* Uncompress the stream. */