Fixed malloc with 0 size.
This commit is contained in:
parent
d83af81295
commit
30ea9f5056
@ -404,7 +404,9 @@ int rdtk_font_parse_descriptor_buffer(rdtkFont* font, BYTE* buffer, int size)
|
||||
}
|
||||
|
||||
font->glyphCount = count;
|
||||
font->glyphs = (rdtkGlyph*) calloc(font->glyphCount, sizeof(rdtkGlyph));
|
||||
font->glyphs = NULL;
|
||||
if (count > 0)
|
||||
font->glyphs = (rdtkGlyph*) calloc(font->glyphCount, sizeof(rdtkGlyph));
|
||||
|
||||
if (!font->glyphs)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user