summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-03-24 10:13:47 +0000
committerDave Chapman <dave@dchapman.com>2008-03-24 10:13:47 +0000
commit6d9c353f2e1ff4f1bc24130dca71aded053fcec3 (patch)
tree834c74dfb34c7d0c4d081f1227c2b76258a31dbf /apps
parent395b785a79c77f65fa1ddaa76bf0bb13267195da (diff)
downloadrockbox-6d9c353f2e1ff4f1bc24130dca71aded053fcec3.tar.gz
rockbox-6d9c353f2e1ff4f1bc24130dca71aded053fcec3.zip
Add another safety-check in the bitmap strips parsing - don't allow the num_subimages parameter to %xl to be <= 0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16779 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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,
516 pos = strchr(ptr, '|'); 516 pos = strchr(ptr, '|');
517 if (pos && pos < newline) 517 if (pos && pos < newline)
518 wps_data->img[n].num_subimages = atoi(ptr); 518 wps_data->img[n].num_subimages = atoi(ptr);
519
520 if (wps_data->img[n].num_subimages <= 0)
521 return WPS_ERROR_INVALID_PARAM;
519 } 522 }
520 523
521 /* Skip the rest of the line */ 524 /* Skip the rest of the line */