summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-12 10:26:23 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-12 10:26:23 +0000
commitedf06b7324e1d5fd6d2e342fe4c069727ced22dd (patch)
tree2bda407e8a72298f0cba4c64b57b56aa48364cba
parent8ec2873fba9bc10deec716ccd55cef49def11ce7 (diff)
downloadrockbox-edf06b7324e1d5fd6d2e342fe4c069727ced22dd.tar.gz
rockbox-edf06b7324e1d5fd6d2e342fe4c069727ced22dd.zip
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
-rw-r--r--apps/gui/skin_engine/skin_fonts.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_fonts.c b/apps/gui/skin_engine/skin_fonts.c
index 23255aa8cc..a89b76281b 100644
--- a/apps/gui/skin_engine/skin_fonts.c
+++ b/apps/gui/skin_engine/skin_fonts.c
@@ -96,11 +96,11 @@ int skin_font_load(char* font_name, int glyphs)
96 glyphs = GLYPHS_TO_CACHE; 96 glyphs = GLYPHS_TO_CACHE;
97#ifndef __PCTOOL__ 97#ifndef __PCTOOL__
98 skin_font_size = font_glyphs_to_bufsize(filename, glyphs); 98 skin_font_size = font_glyphs_to_bufsize(filename, glyphs);
99#else
100 skin_font_size = 1;
99#endif 101#endif
100 if ( !skin_font_size ) 102 if ( !skin_font_size )
101 { 103 return -1;
102 skin_font_size = SKIN_FONT_SIZE;
103 }
104 pf->buffer_start = (char*)skin_buffer_alloc(skin_font_size); 104 pf->buffer_start = (char*)skin_buffer_alloc(skin_font_size);
105 if (!pf->buffer_start) 105 if (!pf->buffer_start)
106 return -1; 106 return -1;