From: rikky Date: Tue, 22 Sep 2009 18:47:17 +0000 (+0000) Subject: Fix:graphics/win32:Fixed memory corruption, if cursor position has not been set on... X-Git-Tag: navit-0.5.0.5194svn~2596 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31b556911bbc02e589d2de6a8173facbae6c011f;p=profile%2Fivi%2Fnavit.git Fix:graphics/win32:Fixed memory corruption, if cursor position has not been set on program startup git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2595 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/graphics/win32/graphics_win32.c b/navit/navit/graphics/win32/graphics_win32.c index 6b9791a..7832df3 100644 --- a/navit/navit/graphics/win32/graphics_win32.c +++ b/navit/navit/graphics/win32/graphics_win32.c @@ -332,7 +332,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l #endif while ( !gra_priv->disabled && overlay && !overlay->disabled ) { - if ( overlay->p.x < gra_priv->width && overlay->p.y < gra_priv->height ) + if ( overlay->p.x > 0 && + overlay->p.y > 0 && + overlay->p.x + overlay->width < gra_priv->width && + overlay->p.y + overlay->height < gra_priv->height ) { #ifdef FAST_TRANSPARENCY @@ -755,7 +758,8 @@ static void draw_drag(struct graphics_priv *gr, struct point *p) gr->p.x = p->x; gr->p.y = p->y; - if ( p->x < 0 || p->y < 0 ) + if ( p->x < 0 || p->y < 0 || + ( gr->parent && ((p->x + gr->width > gr->parent->width) || (p->y + gr->height > gr->parent->height) ))) { gr->disabled = TRUE; }