diff options
author | Tim E. Real <termtech@rogers.com> | 2010-12-14 20:06:14 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2010-12-14 20:06:14 +0000 |
commit | d3d0a38e8c203d658207fb0c8736c046658ceaaa (patch) | |
tree | e67ca04f64948d96b5f51f91a4b20d23b4093063 /muse2/muse/liste/editevent.cpp | |
parent | 37d66824699fad3727f1c035a8ad98dc21782757 (diff) |
Fixed corruption to due latin1() conversions.
Diffstat (limited to 'muse2/muse/liste/editevent.cpp')
-rw-r--r-- | muse2/muse/liste/editevent.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp index efcb8e84..b162a3e6 100644 --- a/muse2/muse/liste/editevent.cpp +++ b/muse2/muse/liste/editevent.cpp @@ -86,6 +86,8 @@ char* hex2string(QWidget* parent, const char* src, int& len) } } len = dst - buffer; + if(len == 0) + return 0; char* b = new char[len+1]; memcpy(b, buffer, len); b[len] = 0; @@ -805,8 +807,7 @@ void EditCtrlDialog::updatePatch() int port = track->outPort(); int channel = track->outChannel(); MidiInstrument* instr = midiPorts[port].instrument(); - const char* name = instr->getPatchName(channel, val, song->mtype(), track->type() == Track::DRUM); - patchName->setText(QString(name)); + patchName->setText(instr->getPatchName(channel, val, song->mtype(), track->type() == Track::DRUM)); int hb = ((val >> 16) & 0xff) + 1; if (hb == 0x100) |