aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2009-09-13 11:02:39 +0000
committerTorbjörn Andersson2009-09-13 11:02:39 +0000
commitbcc840c95c6f5f4ec62523cd007ea415e474c6d8 (patch)
tree5786ee899a7ea249b293d748ab33a6cf07ef9285 /engines
parent31585ebac06014db420bf2688036b935f54a4082 (diff)
downloadscummvm-rg350-bcc840c95c6f5f4ec62523cd007ea415e474c6d8.tar.gz
scummvm-rg350-bcc840c95c6f5f4ec62523cd007ea415e474c6d8.tar.bz2
scummvm-rg350-bcc840c95c6f5f4ec62523cd007ea415e474c6d8.zip
Fixed crash when reaching the end of the movie, riggered by recent Stream
changes. svn-id: r44052
Diffstat (limited to 'engines')
-rw-r--r--engines/groovie/vdx.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp
index 3e3e88a01d..6e0762a9fe 100644
--- a/engines/groovie/vdx.cpp
+++ b/engines/groovie/vdx.cpp
@@ -123,17 +123,21 @@ uint16 VDXPlayer::loadInternal() {
bool VDXPlayer::playFrameInternal() {
byte currRes = 0x80;
Common::ReadStream *vdxData = 0;
- while (!_file->eos() && currRes == 0x80) {
+ while (currRes == 0x80) {
currRes = _file->readByte();
// Skip unknown data: 1 byte, ref Edward
byte tmp = _file->readByte();
- debugC(5, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Edward = 0x%04X", tmp);
uint32 compSize = _file->readUint32LE();
uint8 lengthmask = _file->readByte();
uint8 lengthbits = _file->readByte();
+ if (_file->eos())
+ break;
+
+ debugC(5, kGroovieDebugVideo | kGroovieDebugUnknown | kGroovieDebugAll, "Groovie::VDX: Edward = 0x%04X", tmp);
+
// Read the chunk data and decompress if needed
if (compSize)
vdxData = _file->readStream(compSize);