From 4d9b1e98f4f3cd7387491ba1cc883230302a9022 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 25 Jan 2019 22:44:17 +0800 Subject: Fixed a crash caused by improper preset probing. Further ensure CC#8 is initialized correctly. Minor string table update. --- qmidiplayer-desktop/qmpplugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'qmidiplayer-desktop/qmpplugin.cpp') 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); } -- cgit v1.2.3