]> git.mxchange.org Git - flightgear.git/commitdiff
GPS: make 'loadRouteWaypoint' robust about bad scratch/index values.
authorjmt <jmt>
Sun, 20 Dec 2009 22:19:32 +0000 (22:19 +0000)
committerTim Moore <timoore@redhat.com>
Tue, 22 Dec 2009 06:44:24 +0000 (07:44 +0100)
src/Instrumentation/gps.cxx

index 0343a19d24f72201f23607839b1038a93db6fe2f..1dd72d9fcb672e07f53f886578b4153ee9304d4d 100644 (file)
@@ -1381,7 +1381,7 @@ void GPS::loadRouteWaypoint()
   int index = _scratchNode->getIntValue("index", -9999);
   clearScratch();
   
-  if (index == -9999) { // no index supplied, use current wp
+  if ((index < 0) || (index >= _routeMgr->size())) { // no index supplied, use current wp
     index = _routeMgr->currentWaypoint();
   }