bugThe FreeType Project - Bugs: bug #52613, FT_Bitmap_Embolden is broken in...

 
 

bug #52613: FT_Bitmap_Embolden is broken in 2.8.1

Submitted by:  Zhang Boyang <zby>
Submitted on:  Thu 07 Dec 2017 02:38:53 PM UTC  
 
Severity: 3 - NormalItem Group: None
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.

 

Fri 08 Dec 2017 04:57:19 PM UTC, comment #4:

OK, I can comfirm the latest git version worked for me. Thank you!

Zhang Boyang <zby>
Fri 08 Dec 2017 08:56:11 AM UTC, comment #3:

Thanks for the report! This should be fixed now in git, please test.

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 07 Dec 2017 10:26:16 PM UTC, comment #2:

This is this issue.

The issue is memory management in this commit, not emboldening. Reassigning back to Werner.

Alexei Podtelezhnikov <podtelez>
Project Member
Thu 07 Dec 2017 03:58:57 PM UTC, comment #1:

Alexei, please have a look!

Werner LEMBERG <wl>
Project AdministratorIn charge of this item.
Thu 07 Dec 2017 02:38:53 PM UTC, original submission:

I'm using freetype to render fonts in a game, it worked very well. However, after upgrading from 2.8 to 2.8.1, I found FT_Bitmap_Embolden() is broken.

As you can see in the attachment, there is a random line at left border of each character. I'm using FT_Bitmap_Embolden(library, &bmp, 64, 0) to embold those characters.

After some debugging, I found the problem was introduced in commit bd28952e23bcd268a623ea5202e1cde4a92defe4 ([base] Don't zero out allocated memory twice (#51816).)

When FT_Bitmap_Embolden() is called, it tries to reallocate the internal buffer using ft_bitmap_assure_buffer(). In that function, when buffer allocation is needed, it uses FT_QALLOC_MULT() to allocate memory and does NOT zero out the memory. In other words, it assumed that FT_QALLOC_MULT() will zero the newly allocated memory.

Unfortunately, in that commit, the sematic of ft_mem_qrealloc() is changed, leaving the new buffer uninitialized. My suggestion is to revert that "optimiztion", because the change of sematic may cause other serious problems that we don't know.

Zhang Boyang <zby>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42591:  ft281bug.bmp added by zby (116KiB - image/bmp)

 

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 zby (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
    Fri 08 Dec 2017 08:56:11 AM UTCwlStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Planned ReleaseNone=>2.8.2
    Thu 07 Dec 2017 10:26:16 PM UTCpodtelezAssigned topodtelez=>wl
    Thu 07 Dec 2017 03:58:57 PM UTCwlAssigned toNone=>podtelez
    Thu 07 Dec 2017 02:38:53 PM UTCzbyAttached File-=>Added ft281bug.bmp, #42591

    Back to the top


    Powered by Savane 3.1-cleanup1