summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/wps_parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index c0a1202..e72079c 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 */