bugThe FreeType Project - Bugs: bug #24819, Uninitialized cmap_info.format...

 
 

bug #24819: Uninitialized cmap_info.format field.

Submitted by:  Tor Andersson <ccxvii>
Submitted on:  Tue 11 Nov 2008 10:25:41 PM UTC  
 
Severity: 3 - NormalItem Group: Incorrect behaviour
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 27 Oct 2016 02:41:10 PM UTC, comment #5:

Synthetic CFF cmaps now trigger Invalid_CharMap_Format, and FT_Get_CMap_Format returns -1 as a result..

Alexei Podtelezhnikov <podtelez>
Project Member
Fri 14 Oct 2016 06:46:14 PM UTC, comment #4:

I decided to reopen this bug and solicit Werner's feedback. The problem here is that FT_Get_CMap_Format currently returns 0 for cmaps originating from CFF charset when it should return -1. Two solutions are proposed.

1. cff_get_cmap_info should return without error and do
cmap_info->language = 0;
cmap_info->format = -1;
2. cff_get_cmap_info should return an error (which?), not bother with initialization, and let FT_Get_CMap_{Language_ID, Format} handle the situation, which is implemented already.

Keep in mind that CFF charsets have their own format version, should we want to return that someday.

Alexei Podtelezhnikov <podtelez>
Project Member
Thu 13 Oct 2016 02:16:58 PM UTC, comment #3:

I think it should have been

so that FT_Get_CMap_Format returns -1 as specified for cmaps other than TrueType/sfnt. FT_Get_CMap_Format returns 0 for CFF charmaps, which seems wrong.

Or, should FT_Get_Cmap_Format return charset table format for CFF faces?

Alexei Podtelezhnikov <podtelez>
Project Member
Wed 12 Nov 2008 12:40:07 PM UTC, comment #2:

Re: 14. I'm referring to FT_Set_Charmap() where it tests the FT_Get_CMap_Format() return value.

Tor Andersson <ccxvii>
Wed 12 Nov 2008 06:30:38 AM UTC, comment #1:

Patch applied to the CVS, thanks. I've also documented the
`format' field in the TT_CmapInfo structure.

Regarding format 14: It's not clear to me which place in the source code you are referring to. Please elaborate.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Tue 11 Nov 2008 10:25:41 PM UTC, original submission:

I'm getting some funny valgrind warnings about uninitialized variables
in freetype. These originate from the patch 1.284, which adds the
variant selector charmaps. In the case of non-OpenType CFF fonts
(and possibly other font formats) the cmap_info.format field is never
initialized in cff_get_cmap_info().

Here is a patch for the CFF driver.

P.S.
You may want to clarify the comments in the source
for the mysterious number "14" and the format field
is not documented in the structure typedef comment.

--- freetype-2.3.7/src/cff/cffdrivr.c 2008-04-11 08:07:03.000000000 +0200
+++ freetype-2.3.7-patched/src/cff/cffdrivr.c 2008-11-11 23:21:50.000000000 +0100
@@ -396,6 +396,7 @@

cmap_info->language = 0;
+ cmap_info->format = 0;

if ( cmap->clazz != &cff_cmap_encoding_class_rec &&
cmap->clazz != &cff_cmap_unicode_class_rec )

Tor Andersson <ccxvii>

 

(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 podtelez (Posted a comment)
  • -unavailable- added by wl (Posted a comment)
  • -unavailable- added by ccxvii (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 27 Oct 2016 02:41:10 PM UTCpodtelezStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Fri 14 Oct 2016 06:46:14 PM UTCpodtelezStatusFixed=>In Progress
      Open/ClosedClosed=>Open
    Wed 12 Nov 2008 06:30:38 AM UTCwlOpen/ClosedOpen=>Closed
      Planned ReleaseNone=>2.3.8
    Wed 12 Nov 2008 06:30:37 AM UTCwlItem GroupNone=>Incorrect behaviour
      StatusNone=>Fixed
      Assigned toNone=>wl

    Back to the top


    Powered by Savane 3.1-cleanup1