From 95c50a4e55c6c6740799ab428f1aaf88a3948f63 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 6 Jan 2006 06:40:27 +0000 Subject: Avoid invalid read/writes in createSound() for now. svn-id: r19926 --- scumm/resource_v7he.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scumm') 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; -- cgit v1.2.3