Use QString for SubPluginFeatures' virtuals

The former virtuals returned `const char*`, which lead to invalid reads when
`LadspaSubPluginFeatures` returned pointers to temporary `QByteArray::data`.
This commit is contained in:
Johannes Lorenz
2019-01-18 23:22:52 +01:00
parent f3b23830fb
commit d5dcebed83
5 changed files with 28 additions and 18 deletions

View File

@@ -44,11 +44,11 @@ LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) :
const char *LadspaSubPluginFeatures::displayName(const Plugin::Descriptor::SubPluginFeatures::Key &k) const
QString LadspaSubPluginFeatures::displayName(const Plugin::Descriptor::SubPluginFeatures::Key &k) const
{
const ladspa_key_t & lkey = subPluginKeyToLadspaKey(&k);
Ladspa2LMMS * lm = Engine::getLADSPAManager();
return lm->getName(lkey).toUtf8().data();
return lm->getName(lkey);
}

View File

@@ -37,7 +37,7 @@ class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures
public:
LadspaSubPluginFeatures( Plugin::PluginTypes _type );
const char* displayName(const Key& k) const override;
QString displayName(const Key& k) const override;
void fillDescriptionWidget( QWidget * _parent,
const Key * _key ) const override;