CID#1158211: out-of-bounds access

This commit is contained in:
Markus Mohrhard
2014-01-19 18:39:56 +01:00
parent 70068f428d
commit 989c7ce9a8

View File

@@ -51,7 +51,7 @@ static double fTimes[DEBUG_TIME_MAX] = { 0.0, 0.0, 0.0 };
double datastream_get_time(int nIdx)
{
if( nIdx < 0 || nIdx > (int)SAL_N_ELEMENTS( fTimes ) )
if( nIdx < 0 || nIdx >= (int)SAL_N_ELEMENTS( fTimes ) )
return -1;
return fTimes[ nIdx ];
}