bugThe FreeType Project - Bugs: bug #52464, Type 1 PFB crashing with encoding...

 
 

bug #52464: Type 1 PFB crashing with encoding length > 256

Submitted by:  Vinit Singh <vinitsingh12>
Submitted on:  Mon 20 Nov 2017 10:22:06 AM UTC  
 
Severity: 3 - NormalItem Group: Crash
Status: FixedPrivacy: Public
Assigned to: Werner LEMBERG <wl>Open/Closed: Closed
Planned Release: 2.8.2

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Tue 28 Nov 2017 09:43:54 AM UTC, comment #11:

That resolves the problem.

Thanks a lot Werner.

Vinit Singh <vinitsingh12>
Mon 27 Nov 2017 09:18:22 PM UTC, comment #10:

Fixed now in git, please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 22 Nov 2017 07:59:13 AM UTC, comment #9:

Yes, please extract the font. I've never heard of the AFP format before, and I don't have any tools on my GNU/Linux box to handle such files (and doing a quick internet search there aren't any, AFAICS).

Funnily, even the `file' program, which has a really large database of file formats, doesn't recognize it properly. Apparently, nobody is using this format in the free software world.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 22 Nov 2017 06:54:44 AM UTC, comment #8:

This is an afp file that contains font and other graphic elemnts. This is one of the formats as we are having a pdf file or postscript file.

If you are not able to extract fonts, then give me some time. I will try to extract pfb out of it and send it to you.

Vinit Singh <vinitsingh12>
Wed 22 Nov 2017 06:48:05 AM UTC, comment #7:

Thanks. However, I've received a file `DFA939.afp', which is certainly not a font. Is this a compressed file? I have no idea what to do with it.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 22 Nov 2017 06:41:32 AM UTC, comment #6:

I have sent you a mail.

Vinit Singh <vinitsingh12>
Wed 22 Nov 2017 06:36:10 AM UTC, comment #5:

If you have problems, please send it to me privately.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Wed 22 Nov 2017 06:34:59 AM UTC, comment #4:

The maximum size of the file that can be attached is around 16 MB. the size of my file is around 6 MB. It takes time to upload, but why it is not showing here I don't know the reason.

Vinit Singh <vinitsingh12>
Tue 21 Nov 2017 07:17:20 PM UTC, comment #3:

... attachment missing ...

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 21 Nov 2017 06:27:21 PM UTC, comment #2:

Thanks Werner for the information.

But there are other font renderes such as font forge, etc which are able to such problematic files.

The FreeType should follow the ideal behavior that is displayed by other RIPs. I am attaching one of such files in which the encoding value reads as 257.

Vinit Singh <vinitsingh12>
Mon 20 Nov 2017 10:40:02 AM UTC, comment #1:

A Type 1 font is invalid if it has an encoding length greater than 256 – according to the PS reference, the index is always a character type; this implies that the `/Encoding' vector must contain at most 256 elements.

Note that a Type 1 font can contain more than 256 glyphs, but this is a completely different issue.

So please provide an example file for your claim.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Mon 20 Nov 2017 10:22:06 AM UTC, original submission:

It is not unusual for Type 1 PFBs to have encoding length greater than 256.

The following code in t1load.c leads to throw an error:

/* only composite fonts (which we don't support) */
/* can have larger values */
if ( count > 256 )
{
FT_ERROR(( "parse_encoding: invalid encoding array size\n" ));
parser->root.error = FT_THROW( Invalid_File_Format );
return;
}

This code has been introduced in ion 2.6.1.

There have been many font renders like font forge and others who are able to suppress this erroneous value(>256) and render the files having font encoding length greater than 256 but FreeType throws an error.

Any chance to get the FreeType behavior conforming to the behavior of other font-renderes i.e. suppress this error.

Vinit Singh <vinitsingh12>

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 27 Nov 2017 09:18:22 PM UTCwlStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.8.2
    Mon 20 Nov 2017 10:40:02 AM UTCwlStatusNone=>Need Info
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1