aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-01-06 06:40:27 +0000
committerTravis Howell2006-01-06 06:40:27 +0000
commit95c50a4e55c6c6740799ab428f1aaf88a3948f63 (patch)
tree67b04435cd948037d6b192fd51ac3084cab2ce0c /scumm
parent86bc87c70a600b7063a33cd37c9824e3b328d4b3 (diff)
downloadscummvm-rg350-95c50a4e55c6c6740799ab428f1aaf88a3948f63.tar.gz
scummvm-rg350-95c50a4e55c6c6740799ab428f1aaf88a3948f63.tar.bz2
scummvm-rg350-95c50a4e55c6c6740799ab428f1aaf88a3948f63.zip
Avoid invalid read/writes in createSound() for now.
svn-id: r19926
Diffstat (limited to 'scumm')
-rw-r--r--scumm/resource_v7he.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp
index 5aee8af021..7c245780c5 100644
--- a/scumm/resource_v7he.cpp
+++ b/scumm/resource_v7he.cpp
@@ -1885,6 +1885,11 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) {
debug(0, "SDAT size1 %d size2 %d", size1, size2);
+ if (size1 <= 0) {
+ debug(0, "createSound: Invalid offset (%d) for sound (%d)", snd1id, size1);
+ return;
+ }
+
if (size2 < size1) {
src = sdat2Ptr + 8;
dst = sdat1Ptr + 8 + _sndOffs1;