From 9a0332cd3fe0840cd96665863829980df7ca43a6 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 5 Jun 2007 05:50:01 +0000 Subject: [PATCH] * src/pfr/pfrgload.c (pfr_glyph_curve_to, pfr_glyph_line_to): Convert assertion into normal FreeType error. --- ChangeLog | 4 ++-- src/pfr/pfrgload.c | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc28864f8..777248a36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,8 +4,8 @@ (pfr_glyph_load_simple): Convert assertion into normal FreeType error. Check `idx'. - (pfr_glyph_load_compound): Convert assertion into normal FreeType - error. + (pfr_glyph_load_compound, pfr_glyph_curve_to, pfr_glyph_line_to): + Convert assertion into normal FreeType error. * src/pfr/pfrtypes.h (PFR_GlyphRec): Comment out unused code. diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c index 6cf1eb87f..d92c30a06 100644 --- a/src/pfr/pfrgload.c +++ b/src/pfr/pfrgload.c @@ -133,7 +133,12 @@ /* check that we have begun a new path */ - FT_ASSERT( glyph->path_begun != 0 ); + if ( !glyph->path_begun ) + { + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); + goto Exit; + } error = FT_GLYPHLOADER_CHECK_POINTS( loader, 1, 0 ); if ( !error ) @@ -147,6 +152,7 @@ outline->n_points++; } + Exit: return error; } @@ -163,7 +169,12 @@ /* check that we have begun a new path */ - FT_ASSERT( glyph->path_begun != 0 ); + if ( !glyph->path_begun ) + { + error = PFR_Err_Invalid_Table; + FT_ERROR(( "pfr_glyph_line_to: invalid glyph data\n" )); + goto Exit; + } error = FT_GLYPHLOADER_CHECK_POINTS( loader, 3, 0 ); if ( !error ) @@ -182,6 +193,7 @@ outline->n_points = (FT_Short)( outline->n_points + 3 ); } + Exit: return error; }