summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-08-17 07:16:57 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-08-17 07:16:57 +0000
commit91aa512754233c1793c3842e793d31ae436c4a25 (patch)
treeae0d71f915528a687c70df7d9836d04708ba9b18 /apps
parent35ffefa6b66be3098751cd6231738d9d46cfac73 (diff)
downloadrockbox-91aa512754233c1793c3842e793d31ae436c4a25.tar.gz
rockbox-91aa512754233c1793c3842e793d31ae436c4a25.zip
fix the %xd<id> tag parser to complain if you try to display an image it hasnt loaded yet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22373 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/skin_engine/skin_parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 20156a665c..a06cb77a34 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -486,12 +486,14 @@ static int parse_image_display(const char *wps_bufptr,
486 /* invalid picture display tag */ 486 /* invalid picture display tag */
487 return WPS_ERROR_INVALID_PARAM; 487 return WPS_ERROR_INVALID_PARAM;
488 } 488 }
489 /* sanity check */
490 img = find_image(n, wps_data);
491 if (!img)
492 return WPS_ERROR_INVALID_PARAM;
489 493
490 if ((subimage = get_image_id(wps_bufptr[1])) != -1) 494 if ((subimage = get_image_id(wps_bufptr[1])) != -1)
491 { 495 {
492 img = find_image(n, wps_data); 496 if (subimage >= img->num_subimages)
493 /* Sanity check */
494 if (!img || subimage >= img->num_subimages)
495 return WPS_ERROR_INVALID_PARAM; 497 return WPS_ERROR_INVALID_PARAM;
496 498
497 /* Store sub-image number to display in high bits */ 499 /* Store sub-image number to display in high bits */