LVSL/RemoteVstPlugin: use big enough buffer when gathering preset names

The RemoteVstPlugin process crashed for plugins with lots of presets
as there was an overflow of the presName buffer. Chosing a bigger buffer
size fixes the problem.

Additionally initialize len variable in loadChunkFromPresetFile().
This commit is contained in:
Tobias Doerffel
2012-02-01 23:26:25 +01:00
parent 50bb56da05
commit 03fcc1b5fc

View File

@@ -894,7 +894,7 @@ void RemoteVstPlugin::rotateProgram( int _len )
void RemoteVstPlugin::loadPrograms( int _len )
{
char presName[4096];
char presName[1024+256*30];
char curProgName[30];
if (isInitialized() == false) return;
bool progNameIndexed = (m_plugin->dispatcher(m_plugin, 29, 0, -1, curProgName, 0) == 1);
@@ -1038,7 +1038,7 @@ void RemoteVstPlugin::loadChunkFromPresetFile( const std::string & _file )
{
void * chunk = NULL;
unsigned int * pLen = new unsigned int[ 1 ];
unsigned int len;
unsigned int len = 0;
sBank * pBank = (sBank*) new char[ sizeof( sBank ) ];
FILE * stream = fopen( _file.c_str(), "r" );
fread ( pBank, 1, 56, stream );