From 894c8091088f7554bc89bf0e1dca38acbdfde4d5 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 13 Sep 2009 12:15:08 +0000 Subject: Fix/band aid the freeze when %V is the first thing (i.e. in line 1) in a .wps (see FS#10596). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22693 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_parser.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/gui/skin_engine') diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index b3a46712de..5f5128533f 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -668,12 +668,15 @@ static int parse_viewport(const char *wps_bufptr, skin_vp->pb = NULL; skin_vp->lines = NULL; if (curr_line) - curr_line->curr_subline->last_token_idx = wps_data->num_tokens - 1; + { + curr_line->curr_subline->last_token_idx = wps_data->num_tokens + - (wps_data->num_tokens > 0 ? 1 : 0); + } + curr_line = NULL; if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) return WPS_ERROR_INVALID_PARAM; - - + if (*ptr == 'l') { if (*(ptr+1) == '|') -- cgit v1.2.3