summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/cff/cffload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/cff/cffload.c')
-rw-r--r--src/3rdparty/freetype/src/cff/cffload.c61
1 files changed, 34 insertions, 27 deletions
diff --git a/src/3rdparty/freetype/src/cff/cffload.c b/src/3rdparty/freetype/src/cff/cffload.c
index 1c6fe51566..12efd18dc4 100644
--- a/src/3rdparty/freetype/src/cff/cffload.c
+++ b/src/3rdparty/freetype/src/cff/cffload.c
@@ -1,19 +1,19 @@
-/***************************************************************************/
-/* */
-/* cffload.c */
-/* */
-/* OpenType and CFF data/program tables loader (body). */
-/* */
-/* Copyright 1996-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * cffload.c
+ *
+ * OpenType and CFF data/program tables loader (body).
+ *
+ * Copyright (C) 1996-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
#include <ft2build.h>
@@ -196,14 +196,14 @@
}
- /*************************************************************************/
- /* */
- /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
- /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
- /* messages during execution. */
- /* */
+ /**************************************************************************
+ *
+ * The macro FT_COMPONENT is used in trace mode. It is an implicit
+ * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
+ * messages during execution.
+ */
#undef FT_COMPONENT
-#define FT_COMPONENT trace_cffload
+#define FT_COMPONENT cffload
/* read an offset from the index's stream current position */
@@ -1398,7 +1398,14 @@
FT_UInt master;
- FT_ASSERT( lenNDV == 0 || NDV );
+ /* protect against malformed fonts */
+ if ( !( lenNDV == 0 || NDV ) )
+ {
+ FT_TRACE4(( " cff_blend_build_vector:"
+ " Malformed Normalize Design Vector data\n" ));
+ error = FT_THROW( Invalid_File_Format );
+ goto Exit;
+ }
blend->builtBV = FALSE;
@@ -2080,13 +2087,13 @@
/*
* Initialize the random number generator.
*
- * . If we have a face-specific seed, use it.
+ * - If we have a face-specific seed, use it.
* If non-zero, update it to a positive value.
*
- * . Otherwise, use the seed from the CFF driver.
+ * - Otherwise, use the seed from the CFF driver.
* If non-zero, update it to a positive value.
*
- * . If the random value is zero, use the seed given by the subfont's
+ * - If the random value is zero, use the seed given by the subfont's
* `initialRandomSeed' value.
*
*/