Commit ea2d48f7 authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen

cppcx: make sure we don't send more args than the extra we set

Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 0c002994
......@@ -40,9 +40,9 @@ namespace libVLCX
c_argv[i++] = _strdup((const char*) VLCString(arg));
}
InitializeHack(c_argv, i);
m_instance = VLC::Instance(argv->Size + extraArgs, c_argv);
for (i = 0; i < argv->Size + extraArgs; ++i)
free(c_argv[i]);
m_instance = VLC::Instance(i, c_argv);
for (unsigned j = 0; j < i; ++j)
free(c_argv[j]);
delete [] c_argv;
}
......@@ -51,7 +51,7 @@ namespace libVLCX
m_dxManager->Trim();
}
void Instance::InitializeHack(char** argv, unsigned int nbArgs)
void Instance::InitializeHack(char** argv, unsigned int & nbArgs)
{
m_dxManager.reset(new DirectXManager);
m_dxManager->CreateSwapPanel(m_chainPanel);
......
......@@ -306,7 +306,7 @@ namespace libVLCX
Windows::Foundation::Collections::IVector<MediaDiscovererDescription^>^ mediaDiscoverers(MediaDiscovererCategory category);
private:
void InitializeHack(char** argv, unsigned int nbArgs);
void InitializeHack(char** argv, unsigned int & nbArgs);
~Instance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment