~supertux-dev/supertux/+git/SDL_ttf:master

Last commit made on 2018-06-12
Get this branch:
git clone -b master https://git.launchpad.net/~supertux-dev/supertux/+git/SDL_ttf

Branch merges

Branch information

Name:
master
Repository:
lp:~supertux-dev/supertux/+git/SDL_ttf

Recent commits

0617926... by Ozkan Sezer <email address hidden>

ran 'chmod -x' on many files

639af3a... by Ozkan Sezer <email address hidden>

make it build with Watcom

55bb1f5... by Sam Lantinga

Updated copyright for 2018

d628c73... by Sam Lantinga

Updated iOS deployment target to 8.0 and added tvOS build target

f2619b6... by Sam Lantinga

Updated iOS project for Xcode 9

2a9f8bc... by Sam Lantinga

Added version macros for SDL_ttf

542f825... by Sam Lantinga

Bye bye Visual Studio 2008

c597f87... by Sam Lantinga

Fixed typo (thanks Tim!)

56474a3... by Sam Lantinga

Fixed bug 2749 - Invalid memory read & write by TTF_RenderUTF8* functions with specific input

Ignacio R. Morelle

Under certain circumstances, the TTF_RenderUTF8* function family (also used by their TTF_RenderUNICODE* and TTF_RenderText* counterparts in SDL_ttf 2.0.12), may read and write to memory preceding an allocated pixmap block, potentially corrupting other structures and causing execution to crash later at a random point, especially during SDL invocations -- either by tripping a libc sanity check ("free(): invalid size" aborts, etc.), or causing a plain segmentation fault.

The affected (base) functions I could identify from runtime testing with valgrind's memcheck tool are:

 * TTF_RenderUTF8_Blended
 * TTF_RenderUTF8_Shaded
 * TTF_RenderUTF8_Solid

From a cursory glance at the code, I suspect TTF_RenderUTF8_Blended_Wrapped is affected as well since it uses the same pattern for copying the glyph from FreeType into the target SDL_Surface's pixmap.

The problematic pattern in question:

    SDL_Surface *textbuf;
    c_glyph *glyph;
    int offset;
    Uint32 *dst_check;
    /* glyph->minx may be negative and less than -offset below! */
    Uint32 *dst = (Uint32*) textbuf->pixels + offset + glyph->minx
    /* (dst < dst_check) is verified later, but (textbuf->pixels >= dst) isn't */

The circumstances for triggering the fault are, unfortunately, very specific:

 * Using the DejaVu Sans font at size 16 to render...
 * A string consisting of an ASCII space followed by a Unicode combining character (U+0361 COMBINING DOUBLE INVERTED BREVE in my tests)

fe2619c... by Sam Lantinga

Fix for bug 3679 - TTF_RenderUTF8_Blended_Wrapped ignores lineSpace

Tim

The TTF_RenderUTF8_Blended_Wrapped function sets lineSpace to 2 and uses it to compute the height of the textbuf SDL_Surface, but lineSpace is ignored when rendering each character. This means that there is no spacing between lines, which causes the characters of some fonts to touch.