ref: 4d2815db504a9a75fb717a1fa9da3d0f5f0881ef
parent: 936346413fab3e31399dc92ebed4f379c701f8f0
author: Werner Lemberg <[email protected]>
date: Fri Jun 1 03:49:31 EDT 2007
(cid_parser_new): Exit properly if no `StartData' has been seen at all.
--- 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.
--- 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 ) )