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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #52613: FT_Bitmap_Embolden is broken in 2.8.1

Submitter:  Zhang Boyang <zby>
Submitted:  Thu 07 Dec 2017 02:38:53 PM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  wl Open/Closed:  Closed
Planned Release:  2.9

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>
Group administrator
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>
Group Member
Thu 07 Dec 2017 03:58:57 PM UTC, comment #1: 

Alexei, please have a look!

Werner LEMBERG <wl>
Group administrator
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.)

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
  • -email is unavailable- added by podtelez (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by zby (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-08 wl StatusNone Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.9
    2017-12-07 podtelez Assigned topodtelez wl
    2017-12-07 wl Assigned toNone podtelez
    2017-12-07 zby Attached File- Added ft281bug.bmp, #42591

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code