=?UTF-8?Q?J=C3=B6rg=20H=C3=B6hle=20?=: mciseq: The code can only handle up to 128 MIDI tracks.

Alexandre Julliard julliard at winehq.org
Thu Oct 25 13:50:45 CDT 2012


Module: wine
Branch: master
Commit: c347af5c6743a20c8aeeaf6540c27300ff2484f0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c347af5c6743a20c8aeeaf6540c27300ff2484f0

Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date:   Wed Sep 26 09:04:39 2012 +0200

mciseq: The code can only handle up to 128 MIDI tracks.

---

 dlls/mciseq/mcimidi.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/mciseq/mcimidi.c b/dlls/mciseq/mcimidi.c
index 49435c8..4fcfb48 100644
--- a/dlls/mciseq/mcimidi.c
+++ b/dlls/mciseq/mcimidi.c
@@ -488,10 +488,10 @@ static DWORD MIDI_mciReadMThd(WINE_MCIMIDI* wmm, DWORD dwOffset)
 	return MCIERR_INVALID_FILE;
     }
 
-    if (wmm->nTracks & 0x8000) {
-	/* this shouldn't be a problem... */
-	WARN("Ouch !! Implementation limitation to 32k tracks per MIDI file is overflowed\n");
-	wmm->nTracks = 0x7FFF;
+    if (wmm->nTracks > 0x80) {
+	/* wTrackNr is 7 bits only */
+	FIXME("Truncating MIDI file with %u tracks\n", wmm->nTracks);
+	wmm->nTracks = 0x80;
     }
 
     if ((wmm->tracks = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_MIDITRACK) * wmm->nTracks)) == NULL) {




More information about the wine-cvs mailing list