summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/pfr/pfrload.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/pfr/pfrload.h')
-rw-r--r--src/3rdparty/freetype/src/pfr/pfrload.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/3rdparty/freetype/src/pfr/pfrload.h b/src/3rdparty/freetype/src/pfr/pfrload.h
index 0a512346b6..36e809a762 100644
--- a/src/3rdparty/freetype/src/pfr/pfrload.h
+++ b/src/3rdparty/freetype/src/pfr/pfrload.h
@@ -4,7 +4,7 @@
/* */
/* FreeType PFR loader (specification). */
/* */
-/* Copyright 2002-2015 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, */
@@ -16,8 +16,8 @@
/***************************************************************************/
-#ifndef __PFRLOAD_H__
-#define __PFRLOAD_H__
+#ifndef PFRLOAD_H_
+#define PFRLOAD_H_
#include "pfrobjs.h"
#include FT_INTERNAL_STREAM_H
@@ -25,14 +25,19 @@
FT_BEGIN_HEADER
+ /* some size checks should be always done (mainly to prevent */
+ /* excessive allocation for malformed data), ... */
+#define PFR_CHECK_SIZE( x ) do \
+ { \
+ if ( p + (x) > limit ) \
+ goto Too_Short; \
+ } while ( 0 )
+
+ /* ... and some only if intensive checking is explicitly requested */
#ifdef PFR_CONFIG_NO_CHECKS
#define PFR_CHECK( x ) do { } while ( 0 )
#else
-#define PFR_CHECK( x ) do \
- { \
- if ( p + (x) > limit ) \
- goto Too_Short; \
- } while ( 0 )
+#define PFR_CHECK PFR_CHECK_SIZE
#endif
#define PFR_NEXT_BYTE( p ) FT_NEXT_BYTE( p )
@@ -112,7 +117,7 @@ FT_BEGIN_HEADER
FT_END_HEADER
-#endif /* __PFRLOAD_H__ */
+#endif /* PFRLOAD_H_ */
/* END */