summaryrefslogtreecommitdiff
path: root/src/winfonts/winfnt.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2010-09-13 07:32:22 +0200
committerWerner Lemberg <wl@gnu.org>2010-09-13 07:32:22 +0200
commit5220ef58c5ac065bd388c6ae7685e661b8e8bc78 (patch)
tree733b964b398367dd42fe1062b220d553f34eee48 /src/winfonts/winfnt.c
parentfd0cdb7b9e9a9bc19c710a601c3fd870e026304b (diff)
downloadfreetype2-5220ef58c5ac065bd388c6ae7685e661b8e8bc78.tar.gz
Fix minor issues reported by <muktha.narayan@wipro.com>.
* src/autofit/aflatin.c (af_latin_compute_stem_width): Remove redundant conditional check. * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. * src/cff/cffload.c (cff_encoding_load): Remove conditional check which always evaluates to `true'. * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): Ditto. * src/truetype/ttinterp.c (Ins_IUP): Ditto. * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if value is already dereferenced. * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
Diffstat (limited to 'src/winfonts/winfnt.c')
-rw-r--r--src/winfonts/winfnt.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 2df9af976..ee17d1665 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver for Windows FNT/FON files */
/* */
-/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009 by */
+/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* Copyright 2003 Huw D M Davies for Codeweavers */
/* Copyright 2007 Dmitry Timoshkov for Codeweavers */
@@ -944,7 +944,7 @@
FT_Int32 load_flags )
{
FNT_Face face = (FNT_Face)FT_SIZE_FACE( size );
- FNT_Font font = face->font;
+ FNT_Font font;
FT_Error error = FNT_Err_Ok;
FT_Byte* p;
FT_Int len;
@@ -955,7 +955,15 @@
FT_UNUSED( load_flags );
- if ( !face || !font ||
+ if ( !face )
+ {
+ error = FNT_Err_Invalid_Argument;
+ goto Exit;
+ }
+
+ font = face->font;
+
+ if ( !font ||
glyph_index >= (FT_UInt)( FT_FACE( face )->num_glyphs ) )
{
error = FNT_Err_Invalid_Argument;