diff options
author | Chris Xiong <chirs241097@gmail.com> | 2019-01-25 22:44:17 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2019-01-25 22:44:17 +0800 |
commit | 4d9b1e98f4f3cd7387491ba1cc883230302a9022 (patch) | |
tree | 7147e208bdab4356e317cb46ea4958de23f6800f /qmidiplayer-desktop/qmpplugin.cpp | |
parent | 003c637ef40e1826b7c829afbfba82ea028e21a5 (diff) | |
download | QMidiPlayer-4d9b1e98f4f3cd7387491ba1cc883230302a9022.tar.xz |
Fixed a crash caused by improper preset probing.
Further ensure CC#8 is initialized correctly.
Minor string table update.
Diffstat (limited to 'qmidiplayer-desktop/qmpplugin.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpplugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpplugin.cpp b/qmidiplayer-desktop/qmpplugin.cpp index 7ef31f3..13d5730 100644 --- a/qmidiplayer-desktop/qmpplugin.cpp +++ b/qmidiplayer-desktop/qmpplugin.cpp @@ -153,7 +153,7 @@ int qmpPluginAPI::getChannelCC(int ch,int cc) {return qmw&&qmw->getPlayer()?qmw->getPlayer()->getCC(ch,cc):0;} int qmpPluginAPI::getChannelPreset(int ch) { - int b,p;char nm[25]; + int b,p;char nm[256]; if(qmw&&qmw->getPlayer()) { qmw->getPlayer()->getChannelPreset(ch,&b,&p,nm); @@ -173,11 +173,11 @@ std::wstring qmpPluginAPI::getWTitle() {return qmw?qmw->getWTitle():L"";} std::string qmpPluginAPI::getChannelPresetString(int ch) { - int b,p;char nm[25],ret[33];ret[0]=0; + int b,p;char nm[256],ret[320];ret[0]=0; if(qmw&&qmw->getPlayer()) { qmw->getPlayer()->getChannelPreset(ch,&b,&p,nm); - sprintf(ret,"%03d:%03d %s",b,p,nm); + snprintf(ret,320,"%03d:%03d %s",b,p,nm); } return std::string(ret); } |