Fixed segfault when writing to MIDI file.

This commit is contained in:
Volker Ruppert 2013-11-12 21:45:49 +00:00
parent dfae141275
commit d75a04b48d
2 changed files with 5 additions and 5 deletions

View File

@ -261,9 +261,9 @@ sound
mode
sb16
enabled
midifile
wavefile
logfile
midi
wave
log
midimode
wavemode
loglevel

View File

@ -3075,10 +3075,10 @@ void bx_sb16_c::writemidicommand(int command, int length, Bit8u data[])
return;
} else if ((BX_SB16_THIS midimode == 2) ||
(BX_SB16_THIS midimode == 3)) {
MIDIDATA = fopen(SIM->get_param_string("midifile", base)->getptr(),"wb");
MIDIDATA = fopen(SIM->get_param_string("midi", base)->getptr(),"wb");
if (MIDIDATA == NULL) {
writelog (MIDILOG(2), "Error opening file %s. Midimode disabled.",
SIM->get_param_string("midifile", base)->getptr());
SIM->get_param_string("midi", base)->getptr());
BX_SB16_THIS midimode = 0;
} else if (BX_SB16_THIS midimode == 2) {
initmidifile();