summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-03-24 14:58:30 +0000
committerDave Chapman <dave@dchapman.com>2008-03-24 14:58:30 +0000
commit2a34943d7fe818818b97d4c5c50cc9c9ae367099 (patch)
tree15cf1f2c28ac81c548660c4f3abac132eea0d8f1
parent196899ebfd1848d2dd698b745621b1c7e199a3a2 (diff)
downloadrockbox-2a34943d7fe818818b97d4c5c50cc9c9ae367099.tar.gz
rockbox-2a34943d7fe818818b97d4c5c50cc9c9ae367099.zip
Hopefully get the viewport position/dimensions validation correct this time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16782 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps_parser.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 940b3e45ed..0a06944ba7 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -593,8 +593,10 @@ static int parse_viewport(const char *wps_bufptr,
#ifdef HAVE_REMOTE_LCD
if (wps_data->remote_wps)
{
- if (((vp->x + vp->width) >= LCD_REMOTE_WIDTH) ||
- ((vp->y + vp->height) >= LCD_REMOTE_HEIGHT))
+ if ((vp->x >= LCD_REMOTE_WIDTH) ||
+ ((vp->x + vp->width) > LCD_REMOTE_WIDTH) ||
+ (vp->y >= LCD_REMOTE_HEIGHT) ||
+ ((vp->y + vp->height) > LCD_REMOTE_HEIGHT))
{
return WPS_ERROR_INVALID_PARAM;
}
@@ -602,8 +604,10 @@ static int parse_viewport(const char *wps_bufptr,
else
#else
{
- if (((vp->x + vp->width) >= LCD_WIDTH) ||
- ((vp->y + vp->height) >= LCD_HEIGHT))
+ if ((vp->x >= LCD_WIDTH) ||
+ ((vp->x + vp->width) > LCD_WIDTH) ||
+ (vp->y >= LCD_HEIGHT) ||
+ ((vp->y + vp->height) > LCD_HEIGHT))
{
return WPS_ERROR_INVALID_PARAM;
}