add missed checks to i_winmusc and i_flmusic

This commit is contained in:
Roman Fomin 2023-06-19 12:47:23 +07:00
parent 2d296deeb0
commit af60bcad49
2 changed files with 15 additions and 0 deletions

View File

@ -222,6 +222,13 @@ static boolean I_FL_InitMusic(int device)
synth = new_fluid_synth(settings); synth = new_fluid_synth(settings);
if (synth == NULL)
{
fprintf(stderr,
"I_FL_InitMusic: FluidSynth failed to initialize synth.\n");
return false;
}
lumpnum = W_CheckNumForName("SNDFONT"); lumpnum = W_CheckNumForName("SNDFONT");
if (lumpnum >= 0) if (lumpnum >= 0)
{ {
@ -337,6 +344,13 @@ static void *I_FL_RegisterSong(void *data, int len)
player = new_fluid_player(synth); player = new_fluid_player(synth);
if (player == NULL)
{
fprintf(stderr,
"I_FL_InitMusic: FluidSynth failed to initialize player.\n");
return NULL;
}
if (IsMid(data, len)) if (IsMid(data, len))
{ {
result = fluid_player_add_mem(player, data, len); result = fluid_player_add_mem(player, data, len);

View File

@ -1432,6 +1432,7 @@ static boolean I_WIN_InitMusic(int device)
if (mmr != MMSYSERR_NOERROR) if (mmr != MMSYSERR_NOERROR)
{ {
MidiError("midiStreamOpen", mmr); MidiError("midiStreamOpen", mmr);
hMidiStream = NULL;
return false; return false;
} }