From b7aca2833286db059db306d0955ca1757f0ed5da Mon Sep 17 00:00:00 2001 From: emamaker Date: Thu, 9 Jun 2022 10:01:03 +0200 Subject: [PATCH] pos-sys-cam: avoid infinite loop when camera has not been seen for a while --- src/system/positions/positionsys_camera.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/positions/positionsys_camera.cpp b/src/system/positions/positionsys_camera.cpp index b15038e..6c4d481 100644 --- a/src/system/positions/positionsys_camera.cpp +++ b/src/system/positions/positionsys_camera.cpp @@ -60,7 +60,7 @@ void PositionSysCamera::update(){ do{ valid_data = getDataAtIndex_backwardsFromCurrent(i); i++; - }while(!valid_data.ySeen && !valid_data.bSeen); + }while(!valid_data.ySeen && !valid_data.bSeen && i < dim); if(valid_data.ySeen || valid_data.bSeen){ posx = valid_data.posx;