From b7e252dfd6fb8a8760325eb382be548639d4f700 Mon Sep 17 00:00:00 2001 From: Michael Flaherty Date: Sun, 13 Jan 2019 13:36:35 -0800 Subject: [PATCH] Prevent FrameIterator OOB Errors (#949) --- core/logic/FrameIterator.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/core/logic/FrameIterator.cpp b/core/logic/FrameIterator.cpp index f2a939c0..0c91db25 100644 --- a/core/logic/FrameIterator.cpp +++ b/core/logic/FrameIterator.cpp @@ -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()