|
Rockbox mail archiveSubject: Skin buffer sizeSkin buffer size
From: Edgar Toernig <froese_at_gmx.de>
Date: Fri, 16 Jul 2010 00:53:41 +0200 Hi, while creating a new WPS for my Clip+ I hit the limit of the skin buffer size. The WPS got bigger because I had to copy most of the classic status bar into the .wps and I'm using three fonts. When hitting the limit, a segfault is thrown in the simulator and in checkwps. The culprit is here: --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c _at__at_ -2229,7 +2229,8 _at__at_ static bool skin_load_fonts(struct wps_data *data) if (font->id < 0) { char *dot = strchr(font->name, '.'); - *dot = '\0'; + if (dot) + *dot = '\0'; font->id = skin_font_load(font->name); } The first time a font fails to load everything is fine. But if it's used in multiple viewports, the parser tries to load it again but this time the extension is already stripped and 'dot' becomes NULL. Anyway, trying to make the WPS load I looked at skin_buffer.c and it seems, the buffer is only sized for a single font. Could this please be increased to i.e. 5 fonts? As more and more themes are using multiple fonts and as the space seems to be shared with images it gets tight easily. The patch I'm using atm: --- a/apps/gui/skin_engine/skin_buffer.c +++ b/apps/gui/skin_engine/skin_buffer.c _at__at_ -67,7 +67,7 _at__at_ #endif -#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER + SKIN_FONT_SIZE) + \ +#define SKIN_BUFFER_SIZE (MAIN_BUFFER + REMOTE_BUFFER + 5*SKIN_FONT_SIZE) + \ (WPS_MAX_TOKENS * sizeof(struct wps_token)) #endif Thanks, ET. PS: Btw, the segfaulting checkwps on the theme server seems to trigger a PHP error: | Warning: join() [function.join]: Invalid arguments passed in | /home/themes/www/upload.php on line 109 Received on 2010-07-16 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |