summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/base/ftpfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/base/ftpfr.c')
-rw-r--r--src/3rdparty/freetype/src/base/ftpfr.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/3rdparty/freetype/src/base/ftpfr.c b/src/3rdparty/freetype/src/base/ftpfr.c
index f9592bb1bb..7425abe33c 100644
--- a/src/3rdparty/freetype/src/base/ftpfr.c
+++ b/src/3rdparty/freetype/src/base/ftpfr.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for accessing PFR-specific data (body). */
/* */
-/* Copyright 2002, 2003, 2004, 2008 by */
+/* Copyright 2002-2004, 2008, 2010, 2013, 2014 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -16,6 +16,8 @@
/***************************************************************************/
#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_PFR_H
@@ -24,10 +26,11 @@
static FT_Service_PfrMetrics
ft_pfr_check( FT_Face face )
{
- FT_Service_PfrMetrics service;
+ FT_Service_PfrMetrics service = NULL;
- FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS );
+ if ( face )
+ FT_FACE_LOOKUP_SERVICE( face, service, PFR_METRICS );
return service;
}
@@ -47,7 +50,7 @@
if ( !face )
- return FT_Err_Invalid_Argument;
+ return FT_THROW( Invalid_Face_Handle );
service = ft_pfr_check( face );
if ( service )
@@ -83,7 +86,7 @@
if ( ametrics_y_scale )
*ametrics_y_scale = y_scale;
- error = FT_Err_Unknown_File_Format;
+ error = FT_THROW( Unknown_File_Format );
}
return error;
@@ -103,7 +106,10 @@
if ( !face )
- return FT_Err_Invalid_Argument;
+ return FT_THROW( Invalid_Face_Handle );
+
+ if ( !avector )
+ return FT_THROW( Invalid_Argument );
service = ft_pfr_check( face );
if ( service )
@@ -127,14 +133,18 @@
FT_Service_PfrMetrics service;
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+
+ if ( !aadvance )
+ return FT_THROW( Invalid_Argument );
+
service = ft_pfr_check( face );
if ( service )
- {
error = service->get_advance( face, gindex, aadvance );
- }
else
/* XXX: TODO: PROVIDE ADVANCE-LOADING METHOD TO ALL FONT DRIVERS */
- error = FT_Err_Invalid_Argument;
+ error = FT_THROW( Invalid_Argument );
return error;
}