summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-09-13 12:15:08 +0000
committerThomas Martitz <kugel@rockbox.org>2009-09-13 12:15:08 +0000
commit894c8091088f7554bc89bf0e1dca38acbdfde4d5 (patch)
tree9732bb36d4b9d9f86f181d6a5f6c76842bf41524 /apps
parent072029161e3e4022ff85c30e89e86d8ca6af7a72 (diff)
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
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_parser.c9
1 files changed, 6 insertions, 3 deletions
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) == '|')