bugThe FreeType Project - Bugs: bug #24485, Type 1 without any glyphs results...

 
 

bug #24485: Type 1 without any glyphs results in a crash

Submitted by:  John Tytgat <joty>
Submitted on:  Wed 08 Oct 2008 03:28:04 PM UTC  
 
Severity: 3 - NormalItem Group: Crash
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.

 

Wed 08 Oct 2008 04:06:00 PM UTC, comment #2:

Applied, thanks.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 08 Oct 2008 03:41:02 PM UTC, comment #1:

This patch was necessary for an older version of FT and I now see that this problem can no longer be reproduced as there is a test on 'loader->num_glyphs' just before the .notdef tests.

This makes that when a Type 1 font does not have any glyphs defined, there isn't a .notdef glyph added either which makes that we have a different situation compared with a Type 1 font with some glyphs defined but not a .notdef glyph as the latter will get a .notdef glyph added.

I attach a better patch implementing the following change "make sure Type 1 font without any glyphs has at least .notdef glyph defined".

(file #16630)

John Tytgat <joty>
Wed 08 Oct 2008 03:28:04 PM UTC, original submission:

In the parse_charstrings() routine (src/type1/t1load.c) there is code to make sure that there is always a .notdef glyph definition as first glyph.

When the font itself does not have a .notdef glyph defined, an artifical .notdef character is made. However the check if the first glyph is a .notdef glyph crashes when we're processing a Type 1 font with no glyphs defined at all. Because that particular test is only done when the .notdef glyph is found during scanning, reversing the test order ('.notdef glyph found' && 'is first glyph a .notdef') solves the crash. See attached patch.

John.
PS: I also removed the useless 'const char ' cast for fixed strings (being 'char ' or 'const char *' already).

John Tytgat <joty>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16630:  type1.crash.p added by joty (1KiB - text/plain)
file #16629:  type1.crash.p added by joty (900B - text/plain - Suggested patch to fix the reported crash)

 

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 (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Oct 2008 04:06:00 PM UTCwlStatusNone=>Fixed
      Assigned toNone=>wl
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
    Wed 08 Oct 2008 03:41:02 PM UTCjotyAttached File-=>Added type1.crash.p, #16630
    Wed 08 Oct 2008 03:28:04 PM UTCjotyAttached File-=>Added type1.crash.p, #16629

    Back to the top


    Powered by Savane 3.1-cleanup1