diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-09-13 12:15:08 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-09-13 12:15:08 +0000 |
commit | 894c8091088f7554bc89bf0e1dca38acbdfde4d5 (patch) | |
tree | 9732bb36d4b9d9f86f181d6a5f6c76842bf41524 | |
parent | 072029161e3e4022ff85c30e89e86d8ca6af7a72 (diff) | |
download | rockbox-894c8091088f7554bc89bf0e1dca38acbdfde4d5.tar.gz rockbox-894c8091088f7554bc89bf0e1dca38acbdfde4d5.zip |
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
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 9 |
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, | |||
668 | skin_vp->pb = NULL; | 668 | skin_vp->pb = NULL; |
669 | skin_vp->lines = NULL; | 669 | skin_vp->lines = NULL; |
670 | if (curr_line) | 670 | if (curr_line) |
671 | curr_line->curr_subline->last_token_idx = wps_data->num_tokens - 1; | 671 | { |
672 | curr_line->curr_subline->last_token_idx = wps_data->num_tokens | ||
673 | - (wps_data->num_tokens > 0 ? 1 : 0); | ||
674 | } | ||
675 | |||
672 | curr_line = NULL; | 676 | curr_line = NULL; |
673 | if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) | 677 | if (!skin_start_new_line(skin_vp, wps_data->num_tokens)) |
674 | return WPS_ERROR_INVALID_PARAM; | 678 | return WPS_ERROR_INVALID_PARAM; |
675 | 679 | ||
676 | |||
677 | if (*ptr == 'l') | 680 | if (*ptr == 'l') |
678 | { | 681 | { |
679 | if (*(ptr+1) == '|') | 682 | if (*(ptr+1) == '|') |