[Scummvm-cvs-logs] scummvm master -> a9e2630d4e272c8b776cab54c47943addec7b807

csnover csnover at users.noreply.github.com
Wed Jun 22 20:38:23 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a9e2630d4e SCI: Assert on seeks past the end of audio resource bundles


Commit: a9e2630d4e272c8b776cab54c47943addec7b807
    https://github.com/scummvm/scummvm/commit/a9e2630d4e272c8b776cab54c47943addec7b807
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-06-22T13:05:18-05:00

Commit Message:
SCI: Assert on seeks past the end of audio resource bundles

This should never be allowed to happen, but currently does on
multi-CD games with different resource bundles on difference CDs
(Phant1, PQ:SWAT, GK2) because the resource manager does not yet
have the ability to handle this situation.

Changed paths:
    engines/sci/resource_audio.cpp



diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 5aeff81..5ab443a 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -869,6 +869,7 @@ void WaveResourceSource::loadResource(ResourceManager *resMan, Resource *res) {
 	if (!fileStream)
 		return;
 
+	assert(fileStream->size() == -1 || res->_fileOffset < fileStream->size());
 	fileStream->seek(res->_fileOffset, SEEK_SET);
 	res->loadFromWaveFile(fileStream);
 	if (_resourceFile)
@@ -922,6 +923,7 @@ void AudioVolumeResourceSource::loadResource(ResourceManager *resMan, Resource *
 			break;
 		}
 	} else {
+		assert(fileStream->size() == -1 || res->_fileOffset < fileStream->size());
 		// original file, directly seek to given offset and get SCI1/SCI1.1 audio resource
 		fileStream->seek(res->_fileOffset, SEEK_SET);
 	}






More information about the Scummvm-git-logs mailing list