video: freetype: Fix a memory leak with a bad parameter

Make sure to free memory used when the scale facture is incorrect.

Reported-by: Coverity (CID: 24068)
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2016-02-21 21:10:26 -07:00 committed by Anatolij Gustschin
parent f6e75ba7fe
commit d5b9d11cb6
1 changed files with 4 additions and 1 deletions

View File

@ -2426,7 +2426,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;
}