summaryrefslogtreecommitdiff
path: root/navit/navit.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-07-13 20:37:35 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-07-13 20:37:35 +0000
commit88fa0daf1415cbf40da3cb7199b745c67cd2e8a5 (patch)
tree536e1c332c21d5ec6f38038bfc12bc4da729a863 /navit/navit.c
parentd045e724b04751c32d9fb16fe557310d6b344ed6 (diff)
downloadnavit-svn-88fa0daf1415cbf40da3cb7199b745c67cd2e8a5.tar.gz
Fix:core:Only draw vehicle if it has a position. Avoids integer overflow caused by bogus coordinates.|Part of fix for #1145.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5545 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navit.c')
-rw-r--r--navit/navit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/navit/navit.c b/navit/navit.c
index 2a92f5a4..7cfc30bb 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -2933,6 +2933,11 @@ navit_remove_callback(struct navit *this_, struct callback *cb)
callback_list_remove(this_->attr_cbl, cb);
}
+static int
+coord_not_set(struct coord c){
+ return !(c.x || c.y);
+}
+
/**
* Toggle the cursor update : refresh the map each time the cursor has moved (instead of only when it reaches a border)
*
@@ -2946,7 +2951,7 @@ navit_vehicle_draw(struct navit *this_, struct navit_vehicle *nv, struct point *
struct point cursor_pnt;
enum projection pro;
- if (this_->blocked)
+ if (this_->blocked||coord_not_set(nv->coord))
return;
if (pnt)
cursor_pnt=*pnt;