diff options
author | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-07-13 20:37:35 +0000 |
---|---|---|
committer | sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-07-13 20:37:35 +0000 |
commit | f75ab18f2499b6b64540985aca9be9682b3a6412 (patch) | |
tree | 536e1c332c21d5ec6f38038bfc12bc4da729a863 /navit/navit.c | |
parent | 9bf6351195580a917a8beaea8ae09b475733305b (diff) | |
download | navit-f75ab18f2499b6b64540985aca9be9682b3a6412.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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/navit/navit.c b/navit/navit.c index 2a92f5a4a..7cfc30bbf 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; |