mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
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
This commit is contained in:
parent
35ffefa6b6
commit
91aa512754
1 changed files with 5 additions and 3 deletions
|
|
@ -486,12 +486,14 @@ static int parse_image_display(const char *wps_bufptr,
|
||||||
/* invalid picture display tag */
|
/* invalid picture display tag */
|
||||||
return WPS_ERROR_INVALID_PARAM;
|
return WPS_ERROR_INVALID_PARAM;
|
||||||
}
|
}
|
||||||
|
/* sanity check */
|
||||||
|
img = find_image(n, wps_data);
|
||||||
|
if (!img)
|
||||||
|
return WPS_ERROR_INVALID_PARAM;
|
||||||
|
|
||||||
if ((subimage = get_image_id(wps_bufptr[1])) != -1)
|
if ((subimage = get_image_id(wps_bufptr[1])) != -1)
|
||||||
{
|
{
|
||||||
img = find_image(n, wps_data);
|
if (subimage >= img->num_subimages)
|
||||||
/* Sanity check */
|
|
||||||
if (!img || subimage >= img->num_subimages)
|
|
||||||
return WPS_ERROR_INVALID_PARAM;
|
return WPS_ERROR_INVALID_PARAM;
|
||||||
|
|
||||||
/* Store sub-image number to display in high bits */
|
/* Store sub-image number to display in high bits */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue