aboutsummaryrefslogtreecommitdiff
path: root/freetype/src/truetype/ttdriver.c
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/src/truetype/ttdriver.c')
-rw-r--r--freetype/src/truetype/ttdriver.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/freetype/src/truetype/ttdriver.c b/freetype/src/truetype/ttdriver.c
index 261135692..c3a7d53ab 100644
--- a/freetype/src/truetype/ttdriver.c
+++ b/freetype/src/truetype/ttdriver.c
@@ -4,7 +4,8 @@
/* */
/* TrueType font driver implementation (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 */
+/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -298,7 +299,15 @@
if ( !size )
return TT_Err_Invalid_Size_Handle;
- if ( !face || glyph_index >= (FT_UInt)face->num_glyphs )
+ if ( !face )
+ return TT_Err_Invalid_Argument;
+
+#ifdef FT_CONFIG_OPTION_INCREMENTAL
+ if ( glyph_index >= (FT_UInt)face->num_glyphs &&
+ !face->internal->incremental_interface )
+#else
+ if ( glyph_index >= (FT_UInt)face->num_glyphs )
+#endif
return TT_Err_Invalid_Argument;
if ( load_flags & FT_LOAD_NO_HINTING )
@@ -393,16 +402,17 @@
tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface )
{
- FT_Library library = driver->library;
FT_Module_Interface result;
FT_Module sfntd;
SFNT_Service sfnt;
- FT_UNUSED(library);
result = ft_service_list_lookup( FT_TT_SERVICES_GET, tt_interface );
if ( result != NULL )
return result;
+ if ( !driver )
+ return NULL;
+
/* only return the default interface from the SFNT module */
sfntd = FT_Get_Module( driver->library, "sfnt" );
if ( sfntd )