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:
Teruaki Kawashima 2010-10-11 13:08:49 +00:00
parent 8e8839c8c2
commit 59f487205c

View file

@ -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)