summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/sfnt/sfwoff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/sfnt/sfwoff.c')
-rw-r--r--src/3rdparty/freetype/src/sfnt/sfwoff.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/src/3rdparty/freetype/src/sfnt/sfwoff.c b/src/3rdparty/freetype/src/sfnt/sfwoff.c
index f0a32e1e06..7c0ce2205e 100644
--- a/src/3rdparty/freetype/src/sfnt/sfwoff.c
+++ b/src/3rdparty/freetype/src/sfnt/sfwoff.c
@@ -4,7 +4,7 @@
*
* WOFF format management (base).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -23,6 +23,9 @@
#include <freetype/ftgzip.h>
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+
+
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
@@ -61,12 +64,11 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = NULL;
stream->close = NULL;
}
- FT_CALLBACK_DEF( int )
+ FT_COMPARE_DEF( int )
compare_offsets( const void* a,
const void* b )
{
@@ -109,7 +111,7 @@
FT_ULong sfnt_offset;
FT_Int nn;
- FT_ULong old_tag = 0;
+ FT_Tag old_tag = 0;
static const FT_Frame_Field woff_header_fields[] =
{
@@ -160,8 +162,7 @@
}
/* Don't trust `totalSfntSize' before thorough checks. */
- if ( FT_ALLOC( sfnt, 12 + woff.num_tables * 16UL ) ||
- FT_NEW( sfnt_stream ) )
+ if ( FT_QALLOC( sfnt, 12 ) || FT_NEW( sfnt_stream ) )
goto Exit;
sfnt_header = sfnt;
@@ -194,13 +195,13 @@
/* tag value, the tables themselves are not. We thus have to */
/* sort them by offset and check that they don't overlap. */
- if ( FT_NEW_ARRAY( tables, woff.num_tables ) ||
- FT_NEW_ARRAY( indices, woff.num_tables ) )
+ if ( FT_QNEW_ARRAY( tables, woff.num_tables ) ||
+ FT_QNEW_ARRAY( indices, woff.num_tables ) )
goto Exit;
- FT_TRACE2(( "\n"
- " tag offset compLen origLen checksum\n"
- " -------------------------------------------\n" ));
+ FT_TRACE2(( "\n" ));
+ FT_TRACE2(( " tag offset compLen origLen checksum\n" ));
+ FT_TRACE2(( " -------------------------------------------\n" ));
if ( FT_FRAME_ENTER( 20L * woff.num_tables ) )
goto Exit;
@@ -326,9 +327,7 @@
}
/* Now use `totalSfntSize'. */
- if ( FT_REALLOC( sfnt,
- 12 + woff.num_tables * 16UL,
- woff.totalSfntSize ) )
+ if ( FT_QREALLOC( sfnt, 12, woff.totalSfntSize ) )
goto Exit;
sfnt_header = sfnt + 12;
@@ -360,8 +359,6 @@
}
else
{
-#ifdef FT_CONFIG_OPTION_USE_ZLIB
-
/* Uncompress with zlib. */
FT_ULong output_len = table->OrigLength;
@@ -377,13 +374,6 @@
error = FT_THROW( Invalid_Table );
goto Exit1;
}
-
-#else /* !FT_CONFIG_OPTION_USE_ZLIB */
-
- error = FT_THROW( Unimplemented_Feature );
- goto Exit1;
-
-#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
}
FT_FRAME_EXIT();
@@ -433,5 +423,12 @@
#undef WRITE_USHORT
#undef WRITE_ULONG
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int sfwoff_dummy_;
+
+#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+
/* END */