summaryrefslogtreecommitdiff
path: root/src/bdf/bdflib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bdf/bdflib.c')
-rw-r--r--src/bdf/bdflib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c
index 8dade71b..512cd62c 100644
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -2123,6 +2123,13 @@
_bdf_list_shift( &p->list, 1 );
s = _bdf_list_join( &p->list, ' ', &slen );
+
+ if ( !s )
+ {
+ error = BDF_Err_Invalid_File_Format;
+ goto Exit;
+ }
+
if ( FT_NEW_ARRAY( p->font->name, slen + 1 ) )
goto Exit;
FT_MEM_COPY( p->font->name, s, slen + 1 );
@@ -2307,11 +2314,19 @@
{
/* The ENDFONT field was never reached or did not exist. */
if ( !( p->flags & _BDF_GLYPHS ) )
+ {
/* Error happened while parsing header. */
FT_ERROR(( "bdf_load_font: " ERRMSG2, lineno ));
+ error = BDF_Err_Corrupted_Font_Header;
+ goto Exit;
+ }
else
+ {
/* Error happened when parsing glyphs. */
FT_ERROR(( "bdf_load_font: " ERRMSG3, lineno ));
+ error = BDF_Err_Corrupted_Font_Glyphs;
+ goto Exit;
+ }
}
}