Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ TSFDEF int tsf_note_on(tsf* f, int preset_index, int key, float vel)
struct tsf_voice* newVoices;
f->voiceNum += 4;
newVoices = (struct tsf_voice*)TSF_REALLOC(f->voices, f->voiceNum * sizeof(struct tsf_voice));
if (!newVoices) return 0;
if (!newVoices) { f->voiceNum -= 4; return 0; }
f->voices = newVoices;
voice = &f->voices[f->voiceNum - 4];
voice[1].playingPreset = voice[2].playingPreset = voice[3].playingPreset = -1;
Expand Down Expand Up @@ -2077,3 +2077,4 @@ TSFDEF float tsf_channel_get_tuning(tsf* f, int channel)
#endif

#endif //TSF_IMPLEMENTATION