Permalink
Browse files

Fix write to empty vector

We were writing to an empty vector when poping the last element.
  • Loading branch information...
TheCycoONE committed Nov 10, 2017
1 parent 099db38 commit db396f5f0f33c189c25f40151ce6dd39f495cca8
Showing with 5 additions and 0 deletions.
  1. +5 −0 CorsixTH/Src/th_pathfind.cpp
@@ -551,6 +551,11 @@ node_t* THPathfinder::_openHeapPop()
node_t *pResult = m_openHeap[0];
node_t *pNode = m_openHeap.back();
m_openHeap.pop_back();
if (m_openHeap.empty()) {
return pResult;
}
m_openHeap[0] = pNode;
int i = 0;
int min = 0;

0 comments on commit db396f5

Please sign in to comment.