aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-07-11 16:51:10 +0000
committerTorbjörn Andersson2006-07-11 16:51:10 +0000
commit21b89308b5595ba05d66cc6d4967a491e36bb585 (patch)
tree05bcda610200706075ccfb00b07b38711b4c5596
parent4ff6685de70773d5484213876dc5eba4ff51335c (diff)
downloadscummvm-rg350-21b89308b5595ba05d66cc6d4967a491e36bb585.tar.gz
scummvm-rg350-21b89308b5595ba05d66cc6d4967a491e36bb585.tar.bz2
scummvm-rg350-21b89308b5595ba05d66cc6d4967a491e36bb585.zip
This should fix bug #1520629 ("No Music in Simon1").
svn-id: r23488
-rw-r--r--NEWS1
-rw-r--r--engines/simon/midi.cpp4
2 files changed, 3 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 465e294dfb..c718036566 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
Simon
- Improved support for international versions of the Feeble Files.
+ - Fixed undefined behaviour when loading music.
Broken Sword 2
- More robust handling of the optional startup.inf file.
diff --git a/engines/simon/midi.cpp b/engines/simon/midi.cpp
index d2d31c1e44..f139f1fa2e 100644
--- a/engines/simon/midi.cpp
+++ b/engines/simon/midi.cpp
@@ -479,14 +479,14 @@ void MidiPlayer::loadMultipleSMF(Common::File *in, bool sfx) {
printf("Expected MThd but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]);
return;
}
- in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
+ in->seek(in->readUint32BE(), SEEK_CUR);
// Now skip all the MTrk blocks
while (true) {
in->read(buf, 4);
if (memcmp(buf, "MTrk", 4))
break;
- in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
+ in->seek(in->readUint32BE(), SEEK_CUR);
}
uint32 pos2 = in->pos() - 4;