diff options
author | eriktorbjorn | 2011-05-08 13:06:10 +0200 |
---|---|---|
committer | eriktorbjorn | 2011-05-08 13:08:09 +0200 |
commit | 3e8a7afeae15f0a6d804d8092ccec2bea7a1a2f3 (patch) | |
tree | a9fbda8a33069b2b0485f88382c5e21540a70ca9 /backends/midi | |
parent | d4e4148a39928e577d588b7cbc26abab453ccbab (diff) | |
download | scummvm-rg350-3e8a7afeae15f0a6d804d8092ccec2bea7a1a2f3.tar.gz scummvm-rg350-3e8a7afeae15f0a6d804d8092ccec2bea7a1a2f3.tar.bz2 scummvm-rg350-3e8a7afeae15f0a6d804d8092ccec2bea7a1a2f3.zip |
CAMD: Added _isOpen checks to send() and sysEx()
At Raziel^'s request. This is the same as the ALSA checks I added
earlier today.
Diffstat (limited to 'backends/midi')
-rw-r--r-- | backends/midi/camd.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index cc791cf7c0..aafc7347f0 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -116,11 +116,21 @@ void MidiDriver_CAMD::close() { } void MidiDriver_CAMD::send(uint32 b) { + if (!_isOpen) { + warning("MidiDriver_CAMD: Got event while not open"); + return; + } + ULONG data = READ_LE_UINT32(&b); _ICamd->PutMidi(_midi_link, data); } void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) { + if (!_isOpen) { + warning("MidiDriver_CAMD: Got SysEx while not open"); + return; + } + unsigned char buf[266]; assert(length + 2 <= ARRAYSIZE(buf)); |