aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/video/coktel_decoder.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp
index 6ebc64592e..15ba049536 100644
--- a/graphics/video/coktel_decoder.cpp
+++ b/graphics/video/coktel_decoder.cpp
@@ -684,11 +684,11 @@ Surface *PreIMDDecoder::decodeNextFrame() {
}
void PreIMDDecoder::processFrame() {
+ _curFrame++;
+
uint16 frameSize = _stream->readUint16LE();
- if (frameSize == 0) {
- _curFrame++;
+ if (_stream->eos() || (frameSize == 0))
return;
- }
uint32 nextFramePos = _stream->pos() + frameSize + 2;
@@ -752,8 +752,6 @@ void PreIMDDecoder::processFrame() {
}
_stream->seek(nextFramePos);
-
- _curFrame++;
}
// Just a simple blit