summaryrefslogtreecommitdiffstats
path: root/apps/gui/wps_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps_parser.c')
-rw-r--r--apps/gui/wps_parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 9327e89859..940b3e45ed 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -516,6 +516,9 @@ static int parse_image_load(const char *wps_bufptr,
pos = strchr(ptr, '|');
if (pos && pos < newline)
wps_data->img[n].num_subimages = atoi(ptr);
+
+ if (wps_data->img[n].num_subimages <= 0)
+ return WPS_ERROR_INVALID_PARAM;
}
/* Skip the rest of the line */