You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 2.0.12 Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2014-08-18 20:45:26 +0000, Joshua Landau wrote:
When using the Hans Kendrick font with SDL2_ttf;
#include <stdio.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
// Very shortened for demo purposes
int main () {
if (SDL_Init(SDL_INIT_VIDEO) != 0) { return 1; }
if (TTF_Init() == -1) { return 1; }
TTF_Font *font = TTF_OpenFont("font.ttf", 28);
if (font == NULL) { return 1; }
SDL_Color blank = {0, 0, 0, 0};
SDL_Color colour = {0, 0, 0, 0};
TTF_RenderUTF8_Shaded(font, "Y", colour, blank);
}
valgrind reports an error;
==18109== Invalid read of size 1
==18109== at 0x535812C: TTF_RenderUTF8_Shaded (in /usr/lib/libSDL2_ttf-2.0.so.0.10.2)
==18109== by 0x40080B: main (in /home/joshua/fontbug/test)
==18109== Address 0xd9aaf4f is 1 bytes before a block of size 560 alloc'd
==18109== at 0x4C28730: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18109== by 0x4ED91FB: ??? (in /usr/lib/libSDL2-2.0.so.0.2.1)
==18109== by 0x5357F00: TTF_RenderUTF8_Shaded (in /usr/lib/libSDL2_ttf-2.0.so.0.10.2)
==18109== by 0x40080B: main (in /home/joshua/fontbug/test)
and some systems crash. This depends on the characters (strings with a space at the front have never had this problem) and possibly the font size.
This is pretty much copied verbatim from my Stack Overflow post on the same issue:
This bug report was migrated from our old Bugzilla tracker.
Reported in version: 2.0.12
Reported for operating system, platform: Linux, x86_64
Comments on the original bug report:
On 2014-08-18 20:45:26 +0000, Joshua Landau wrote:
On 2014-08-20 04:21:53 +0000, Sam Lantinga wrote:
On 2014-09-05 07:22:36 +0000, Joshua Landau wrote:
On 2017-09-10 06:03:29 +0000, Sam Lantinga wrote:
The text was updated successfully, but these errors were encountered: