bugThe FreeType Project - Bugs: bug #28090, a single space in between eexec...

 
 

bug #28090: a single space in between eexec and it's data is not considered valid

Submitted by:  bram tassyns <bramt>
Submitted on:  Wed 25 Nov 2009 09:35:40 AM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.12

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 25 Nov 2009 10:52:18 PM UTC, comment #2:

Fixed in git repository, thanks!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 25 Nov 2009 11:01:55 AM UTC, comment #1:

Actually we have a similar fix for the problem described but also taking care of slightly buggy Type 1 fonts we've seen in the wild, i.e. ones having more than one white space character after the eexec operator.

This is our patch:

freetype\src\type1\t1parse.c
--8<--
T1_Skip_PS_Token( parser );
cur = parser->root.cursor;
- if ( *cur == '\r' )
- {
- cur++;
- if ( *cur == '\n' )
- cur++;
- }
- else if ( *cur == '\n' )
- cur++;
- else
- {
- FT_ERROR(( "T1_Get_Private_Dict:"
- " `eexec' not properly terminated\n" ));
- error = T1_Err_Invalid_File_Format;
- goto Exit;
- }
-
+ /* According the Type1 spec, the first cipher byte must not be an
+ ASCII white space character code (blank, tab, carriage return or line
+ feed). We've seen Type 1 fonts with two line feed characters...

  • So skip now all white character codes now. */

+ while ( cur < limit
+ && ( *cur == ' '
+ || *cur == '\t'
+ || *cur == '\r'
+ || *cur == '\n' ) )
+ ++cur;
+ if ( cur >= limit )
+ {
+ FT_ERROR(( "T1_Get_Private_Dict:"
+ " `eexec' not properly terminated\n" ));
+ error = T1_Err_Invalid_File_Format;
+ goto Exit;
+ }
--8<--

John Tytgat <joty>
Wed 25 Nov 2009 09:35:40 AM UTC, original submission:

If you have a postscript type1 file of the form:

...
currentfile eexec <binary blob>
...

It is not recognized as a font by freetype.

fix: t1parse.c, 407:

else if ( *cur == '\n' )
cur++;
else
{
FT_ERROR(( "T1_Get_Private_Dict:"

=>

else if ( *cur == '\n' )
cur++;
else if ( *cur == ' ' )
cur++;
else
{
FT_ERROR(( "T1_Get_Private_Dict:"

bram tassyns <bramt>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by joty (Posted a comment)
  • -unavailable- added by bramt (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 25 Nov 2009 10:52:18 PM UTCwlPlanned ReleaseNone=>2.3.12
      Open/ClosedOpen=>Closed
      Assigned toNone=>wl
      StatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1