fix crash with out of range thread index

This commit is contained in:
Lunkhound committed 2017-05-29 23:54:15 -07:00
1 parent 34e2c1b784
commit ba88d332fb
1 file changed
+2 -2
+2 -2
View File
@@ -184,7 +184,7 @@ void MyEnterProfileZoneFunc(const char* msg)
return;
#ifndef BT_NO_PROFILE
int threadId = btQuickprofGetCurrentThreadIndex2();
if (threadId<0)
if (threadId<0 || threadId >= BT_QUICKPROF_MAX_THREAD_COUNT)
return;
if (gStackDepths[threadId] >= MAX_NESTING)
@@ -208,7 +208,7 @@ void MyLeaveProfileZoneFunc()
return;
#ifndef BT_NO_PROFILE
int threadId = btQuickprofGetCurrentThreadIndex2();
if (threadId<0)
if (threadId<0 || threadId >= BT_QUICKPROF_MAX_THREAD_COUNT)
return;
if (gStackDepths[threadId] <= 0)