don't leak vertex data if text is scaled to 0

This commit is contained in:
Sean Barrett 2016-04-02 03:55:03 -07:00
parent 538b96d6e2
commit 56e8fd063c
1 changed files with 4 additions and 1 deletions

View File

@ -2435,7 +2435,10 @@ STBTT_DEF unsigned char *stbtt_GetGlyphBitmapSubpixel(const stbtt_fontinfo *info
if (scale_x == 0) scale_x = scale_y;
if (scale_y == 0) {
if (scale_x == 0) return NULL;
if (scale_x == 0) {
STBTT_free(vertices, info->userdata);
return NULL;
}
scale_y = scale_x;
}