From 32bd59d4f75f135b26a537f438e0d6b893f1cdfb Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Sat, 14 Apr 2007 16:20:33 +0000 Subject: Better error checking for the image display tag (%xdn). Should prevent problems with the former crossfeed tag (%xd) when used in a conditional construct. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13158 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/wps_parser.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps') diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index c0a1202eb8..e72079ce71 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c @@ -357,6 +357,14 @@ static int parse_image_display(const char *wps_bufptr, struct wps_data *wps_data) { int n = get_image_id(*wps_bufptr); + + if (n == -1) + { + /* invalid picture display tag */ + token->type = WPS_TOKEN_UNKNOWN; + return 0; + } + token->value.i = n; /* if the image is in a conditional, remember it */ -- cgit v1.2.3