% LD_LIBRARY_PATH=~/local/SDL2-dbg/lib LD_PRELOAD=$LD_LIBRARY_PATH/libSDL2_ttf-2.0.so.0 valgrind ./ttf_test_sdl2 ==9851== Memcheck, a memory error detector ==9851== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==9851== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info ==9851== Command: ./ttf_test_sdl2 ==9851== Rendering Font Render Test 1/5 (Solid) ==9851== Rendering complete Rendering Font Render Test 2/5 (Solid) Rendering complete Rendering Font Render Test 3/5 (Solid) Rendering complete Rendering Font Render Test 4/5 (Solid) ==9851== Invalid read of size 1 ==9851== at 0x4E39DB5: TTF_RenderUTF8_Solid (SDL_ttf.c:1446) ==9851== by 0x401197: main (ttf_test_sdl2_clean.c:170) ==9851== Address 0xcccb51e is 2 bytes before a block of size 380 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E39A78: TTF_RenderUTF8_Solid (SDL_ttf.c:1373) ==9851== by 0x401197: main (ttf_test_sdl2_clean.c:170) ==9851== ==9851== Invalid write of size 1 ==9851== at 0x4E39DBA: TTF_RenderUTF8_Solid (SDL_ttf.c:1446) ==9851== by 0x401197: main (ttf_test_sdl2_clean.c:170) ==9851== Address 0xcccb51e is 2 bytes before a block of size 380 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E39A78: TTF_RenderUTF8_Solid (SDL_ttf.c:1373) ==9851== by 0x401197: main (ttf_test_sdl2_clean.c:170) ==9851== Rendering complete Rendering Font Render Test 5/5 (Solid) Rendering complete Rendering Font Render Test 1/5 (Blended) Rendering complete Rendering Font Render Test 2/5 (Blended) Rendering complete Rendering Font Render Test 3/5 (Blended) Rendering complete Rendering Font Render Test 4/5 (Blended) ==9851== Invalid read of size 4 ==9851== at 0x4E3ACD3: TTF_RenderUTF8_Blended (SDL_ttf.c:1802) ==9851== by 0x401150: main (ttf_test_sdl2_clean.c:163) ==9851== Address 0xcce5f88 is 8 bytes before a block of size 1,368 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E3A9DD: TTF_RenderUTF8_Blended (SDL_ttf.c:1732) ==9851== by 0x401150: main (ttf_test_sdl2_clean.c:163) ==9851== ==9851== Invalid write of size 4 ==9851== at 0x4E3ACE0: TTF_RenderUTF8_Blended (SDL_ttf.c:1802) ==9851== by 0x401150: main (ttf_test_sdl2_clean.c:163) ==9851== Address 0xcce5f88 is 8 bytes before a block of size 1,368 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E3A9DD: TTF_RenderUTF8_Blended (SDL_ttf.c:1732) ==9851== by 0x401150: main (ttf_test_sdl2_clean.c:163) ==9851== Rendering complete Rendering Font Render Test 5/5 (Blended) Rendering complete Rendering Font Render Test 1/5 (Shaded) Rendering complete Rendering Font Render Test 2/5 (Shaded) Rendering complete Rendering Font Render Test 3/5 (Shaded) Rendering complete Rendering Font Render Test 4/5 (Shaded) ==9851== Invalid read of size 1 ==9851== at 0x4E3A5BB: TTF_RenderUTF8_Shaded (SDL_ttf.c:1627) ==9851== by 0x401175: main (ttf_test_sdl2_clean.c:166) ==9851== Address 0xcaa9fce is 2 bytes before a block of size 380 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E3A1D1: TTF_RenderUTF8_Shaded (SDL_ttf.c:1553) ==9851== by 0x401175: main (ttf_test_sdl2_clean.c:166) ==9851== ==9851== Invalid write of size 1 ==9851== at 0x4E3A5C0: TTF_RenderUTF8_Shaded (SDL_ttf.c:1627) ==9851== by 0x401175: main (ttf_test_sdl2_clean.c:166) ==9851== Address 0xcaa9fce is 2 bytes before a block of size 380 alloc'd ==9851== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==9851== by 0x51032AB: SDL_CreateRGBSurface_REAL (SDL_surface.c:90) ==9851== by 0x4E3A1D1: TTF_RenderUTF8_Shaded (SDL_ttf.c:1553) ==9851== by 0x401175: main (ttf_test_sdl2_clean.c:166) ==9851== Rendering complete Rendering Font Render Test 5/5 (Shaded) Rendering complete ==9851== ==9851== HEAP SUMMARY: ==9851== in use at exit: 41,369 bytes in 433 blocks ==9851== total heap usage: 16,856 allocs, 16,423 frees, 169,094,472 bytes allocated ==9851== ==9851== LEAK SUMMARY: ==9851== definitely lost: 448 bytes in 1 blocks ==9851== indirectly lost: 696 bytes in 2 blocks ==9851== possibly lost: 0 bytes in 0 blocks ==9851== still reachable: 40,225 bytes in 430 blocks ==9851== suppressed: 0 bytes in 0 blocks ==9851== Rerun with --leak-check=full to see details of leaked memory ==9851== ==9851== For counts of detected and suppressed errors, rerun with: -v ==9851== Use --track-origins=yes to see where uninitialised values come from ==9851== ERROR SUMMARY: 24 errors from 10 contexts (suppressed: 6 from 1)