Bug #464

Issues with PluginLoader on Windows when UNICODE defined

Added by RJ Ryan almost 12 years ago. Updated almost 11 years ago.

Status:ClosedStart date:2012-05-24
Priority:NormalDue date:
Assignee:Chris Cannam% Done:

0%

Category:-
Target version:-

Description

Windows users of Mixxx 1.11.0 alpha builds aren't able to load VAMP plugins. I dug into the issue a little bit and it seems that this is caused by the use of MultiByteToWideChar and WideCharToMultiByte in PluginLoader.cpp (only used when UNICODE is defined).

MultiByteToWideChar and WideCharToMultiByte don't append a NULL character to the end of strings they convert if you provide an explicit length for the input. Since all 3 of these calls provide explicit lengths for their input strings, none of the outputs had NULL characters at the end, resulting in junk at the end of the string when calling methods like LoadLibrary or FindFirstFile.

The attached patch should fix this. I opted for increasing the length of the input by one since all of the inputs should have a NULL character at the end anyway. This seemed better than the alternative (letting the function auto-detect the end by providing a length of -1) since if there is not space for a NULL character in the output buffer then it won't be appended.

vamp-2.3-windows-unicode.patch Magnifier 1.32 KB, downloaded 24 times RJ Ryan, 2012-05-24 04:02 PM

History

#1 Updated by Chris Cannam almost 12 years ago

  • Status changed from New to Resolved
  • Assignee set to Chris Cannam

Ouch! Applied in 9648ba9812d6, thanks.

#2 Updated by Chris Cannam almost 11 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF