diff --git a/ChangeLog b/ChangeLog index 03124f648..725e216f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/cid/cidparse.c (cid_parser_new): Don't continue second search pass for `StartData' if an error has occurred. + Exit properly if no `StartData' has been seen at all. * builds/unix/ftsystem.c (FT_Stream_Open): Don't use ULONG_MAX but LONG_MAX to avoid compiler warning. Suggested by Sean McBride. diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c index 29e45f979..bb87afc58 100644 --- a/src/cid/cidparse.c +++ b/src/cid/cidparse.c @@ -98,7 +98,11 @@ stream_len = stream->size - FT_STREAM_POS(); if ( stream_len == 0 ) + { + FT_TRACE2(( "cid_parser_new: no `StartData' keyword found\n" )); + error = CID_Err_Unknown_File_Format; goto Exit; + } read_len = FT_MIN( read_len, stream_len ); if ( FT_STREAM_READ( p, read_len ) )