diff options
Diffstat (limited to 'engines/lastexpress/sound/entry.cpp')
-rw-r--r-- | engines/lastexpress/sound/entry.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/engines/lastexpress/sound/entry.cpp b/engines/lastexpress/sound/entry.cpp index 3d22657124..697e6e1269 100644 --- a/engines/lastexpress/sound/entry.cpp +++ b/engines/lastexpress/sound/entry.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -33,7 +33,6 @@ #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" - namespace LastExpress { #define SOUNDCACHE_ENTRY_SIZE 92160 @@ -267,6 +266,8 @@ void SoundEntry::update(uint val) { } bool SoundEntry::updateSound() { + assert(_name2.size() <= 16); + bool result; char sub[16]; @@ -279,6 +280,7 @@ bool SoundEntry::updateSound() { _status.status &= ~0x8000; strcpy(sub, _name2.c_str()); + // FIXME: Rewrite and document expected behavior int l = strlen(sub) + 1; if (l - 1 > 4) sub[l - (1 + 4)] = 0; @@ -361,7 +363,10 @@ void SoundEntry::showSubtitle(Common::String filename) { } void SoundEntry::saveLoadWithSerializer(Common::Serializer &s) { - if (_name2.matchString("NISSND?") && (_status.status & kFlagType7) != kFlag3) { + assert(_name1.size() <= 16); + assert(_name2.size() <= 16); + + if (_name2.matchString("NISSND?") && (_status.status & kFlagType9) != kFlag3) { s.syncAsUint32LE(_status.status); s.syncAsUint32LE(_type); s.syncAsUint32LE(_blockCount); // field_8; |