Commit 226469d0 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

I do not feel like releasing pvlc, lets break it a bit more, just to be sure...

msv doesnt like dynamic arrays, so we just hardcode the libvlc arguments to 64, a new assert will fall over if the argument qstringlist actually exceeds the char** in size
parent 2ee94859
......@@ -99,13 +99,18 @@ bool LibVLC::init()
// Build const char* array
const char *vlcArgs[args.size()-1];
// MSVC does not support dynamic arrays, so we assume a fixed size
// of 64 as sufficient.
Q_ASSERT_X( 64 > args.size(), "libvlc init",
"maximum amount of arguments exceeded, "
"increase size of char**");
const char *vlcArgs[64];
for (int i = 0; i < args.size(); ++i) {
vlcArgs[i] =;
// Create and initialize a libvlc instance (it should be done only once)
self->m_vlcInstance = libvlc_new(sizeof(vlcArgs) / sizeof(*vlcArgs), vlcArgs);
self->m_vlcInstance = libvlc_new(args.size()-1, vlcArgs);
if (!self->m_vlcInstance) {
fatal() << "libVLC:" << LibVLC::errorMessage();
return false;
Supports Markdown
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