bugThe FreeType Project - Bugs: bug #24150, infinite loop when parsing wierd...

 
 

bug #24150: infinite loop when parsing wierd type1 cid font

Submitted by:  None
Submitted on:  Wed 27 Aug 2008 10:19:32 AM UTC  
 
Severity: 3 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.3.8

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 28 Aug 2008 04:15:33 PM UTC, comment #1:

Applied, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 27 Aug 2008 10:19:32 AM UTC, original submission:

Attached is a wierd type1 cid font that was found on one of our systems (doesn't seem to contain any glyph data, don't know how it was created either). Parsing this file with freetype results in an infinite loop when parsing the encoding. I propose the following fix in t1load.c:

static void
parse_encoding( T1_Face face,
T1_Loader loader )
{
...
if ( ft_isdigit( *cur ) || only_immediates )
...

if ( *cur == '/' && cur + 2 < limit && n < count )
{
...
}
}

=>

static void
parse_encoding( T1_Face face,
T1_Loader loader )
{
...
if ( ft_isdigit( *cur ) || only_immediates )
...

if ( *cur == '/' && cur + 2 < limit && n < count )
{
...
}
else if ( only_immediates )
{
// since the current position is not updated for immediates only mode
// we would get an infinite loop if we don't do anything here
//
// this encoding array is not according to the type1 spec
// (it might be an encoding for a CID type1 font however),
// so we conclude that this font is NOT a type1 font
parser->root.error = FT_Err_Unknown_File_Format;
return;
}
}

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16364:  CTTmp27 added by None (410B - application/octet-stream)

 

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)
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Sep 2008 06:43:08 AM UTCwlAssigned toNone=>wl
    Thu 28 Aug 2008 04:15:33 PM UTCwlStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
    Wed 27 Aug 2008 10:19:32 AM UTCNoneAttached File-=>Added CTTmp27, #16364

    Back to the top


    Powered by Savane 3.1-cleanup1