Prevent FrameIterator OOB Errors (#949)

This commit is contained in:
Michael Flaherty 2019-01-13 13:36:35 -08:00 committed by GitHub
parent a2246af121
commit b7e252dfd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,18 +46,13 @@ SafeFrameIterator::SafeFrameIterator(IFrameIterator *it)
bool SafeFrameIterator::Done() const
{
return current == frames.length();
return current >= frames.length();
}
bool SafeFrameIterator::Next()
{
if (!this->Done())
{
current++;
return true;
}
return false;
current++;
return !this->Done();
}
void SafeFrameIterator::Reset()