FIX:core:Do not crash if item speed is zero
authorzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 22 Oct 2008 23:07:31 +0000 (23:07 +0000)
committerzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Wed, 22 Oct 2008 23:07:31 +0000 (23:07 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@1539 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/route.c

index 0f5e995..3fb20f1 100644 (file)
@@ -1061,7 +1061,8 @@ route_graph_destroy(struct route_graph *this)
 int
 route_time(int *speedlist, struct item *item, int len)
 {
-       if (item->type < route_item_first || item->type > route_item_last) {
+       if (item->type < route_item_first || item->type > route_item_last
+               || !speedlist[item->type-route_item_first]) {
                dbg(0,"street type %d out of range [%d,%d]", item->type, route_item_first, route_item_last);
                return len*36;
        }