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.
|