check viewport dimension when parsing viewport so that player doesn't clash with bad wps.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28244 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8e8839c8c2
commit
59f487205c
1 changed files with 6 additions and 2 deletions
|
@ -1313,10 +1313,14 @@ static int convert_viewport(struct wps_data *data, struct skin_element* element)
|
|||
{
|
||||
skin_vp->vp.font = param->data.number;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
if ((unsigned) skin_vp->vp.x >= (unsigned) display->lcdwidth ||
|
||||
skin_vp->vp.width + skin_vp->vp.x > display->lcdwidth ||
|
||||
(unsigned) skin_vp->vp.y >= (unsigned) display->lcdheight ||
|
||||
skin_vp->vp.height + skin_vp->vp.y > display->lcdheight)
|
||||
return CALLBACK_ERROR;
|
||||
|
||||
return CALLBACK_OK;
|
||||
|
||||
}
|
||||
|
||||
static int skin_element_callback(struct skin_element* element, void* data)
|
||||
|
|
Loading…
Reference in a new issue