Skip to content

Commit b7e252d

Browse files
authored
Prevent FrameIterator OOB Errors (#949)
1 parent a2246af commit b7e252d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

core/logic/FrameIterator.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,13 @@ SafeFrameIterator::SafeFrameIterator(IFrameIterator *it)
4646

4747
bool SafeFrameIterator::Done() const
4848
{
49-
return current == frames.length();
49+
return current >= frames.length();
5050
}
5151

5252
bool SafeFrameIterator::Next()
5353
{
54-
if (!this->Done())
55-
{
56-
current++;
57-
return true;
58-
}
59-
60-
return false;
54+
current++;
55+
return !this->Done();
6156
}
6257

6358
void SafeFrameIterator::Reset()

0 commit comments

Comments
 (0)