From 2a34943d7fe818818b97d4c5c50cc9c9ae367099 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Mon, 24 Mar 2008 14:58:30 +0000 Subject: 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 --- apps/gui/wps_parser.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps') 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; } -- cgit v1.2.3