if font_glyphs_to_bufsize() returns 0 it means the font couldnt be loaded, so allocating the buffer size is pointless

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30512 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-09-12 10:26:23 +00:00
parent 8ec2873fba
commit edf06b7324

View file

@ -96,11 +96,11 @@ int skin_font_load(char* font_name, int glyphs)
glyphs = GLYPHS_TO_CACHE; glyphs = GLYPHS_TO_CACHE;
#ifndef __PCTOOL__ #ifndef __PCTOOL__
skin_font_size = font_glyphs_to_bufsize(filename, glyphs); skin_font_size = font_glyphs_to_bufsize(filename, glyphs);
#else
skin_font_size = 1;
#endif #endif
if ( !skin_font_size ) if ( !skin_font_size )
{ return -1;
skin_font_size = SKIN_FONT_SIZE;
}
pf->buffer_start = (char*)skin_buffer_alloc(skin_font_size); pf->buffer_start = (char*)skin_buffer_alloc(skin_font_size);
if (!pf->buffer_start) if (!pf->buffer_start)
return -1; return -1;