forked from len0rd/rockbox
Small simplification - take advantage of the fact that x/y/width/height are non-negative integers when validating the viewport bounds.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16736 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
45b2d8802d
commit
bca8edd856
1 changed files with 2 additions and 5 deletions
|
|
@ -564,9 +564,7 @@ static int parse_viewport(const char *wps_bufptr,
|
|||
#ifdef HAVE_REMOTE_LCD
|
||||
if (wps_data->remote_wps)
|
||||
{
|
||||
if ((vp->x >= LCD_REMOTE_WIDTH) ||
|
||||
((vp->x + vp->width) >= LCD_REMOTE_WIDTH) ||
|
||||
(vp->y >= LCD_REMOTE_HEIGHT) ||
|
||||
if (((vp->x + vp->width) >= LCD_REMOTE_WIDTH) ||
|
||||
((vp->y + vp->height) >= LCD_REMOTE_HEIGHT))
|
||||
{
|
||||
return WPS_ERROR_INVALID_PARAM;
|
||||
|
|
@ -575,8 +573,7 @@ static int parse_viewport(const char *wps_bufptr,
|
|||
else
|
||||
#else
|
||||
{
|
||||
if ((vp->x >= LCD_WIDTH) ||
|
||||
(vp->y >= LCD_HEIGHT) ||
|
||||
if (((vp->x + vp->width) >= LCD_WIDTH) ||
|
||||
((vp->y + vp->height) >= LCD_HEIGHT))
|
||||
{
|
||||
return WPS_ERROR_INVALID_PARAM;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue