Explicitly handle VST2 callbacks with nullptrs

This is probably not needed, but we'll do it just in case another plugin
does something similar.
This commit is contained in:
Robbert van der Helm
2021-04-25 22:43:45 +02:00
parent 86bd19cd80
commit 3e71fc19b8
2 changed files with 31 additions and 5 deletions
+7 -1
View File
@@ -13,6 +13,12 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- When building the package from source, the targetted Wine version gets printed
at configure-time. This can make it a bit easier to diagnose Wine-related
compilation issues.
- Yabridge automatically handles most common VST2 functions by simply inspecting
the argument types. This works practically everywhere, but Plugsound Free by
UVI would pass unreadable function arguments to functions that are not
supposed to have any arguments, causing yabridge to crash. To prevent similar
situations from happening in the future, yabridge now specifically handles
most common VST2 functions that don't have a data argument.
### Fixed
@@ -22,7 +28,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Prevent _Native Instruments' FM7_ from crashing when processing MIDI. As a
fix, MIDI events are now deallocated later then when they normally would have
to be.
- Prevent _Plugsound Free_ by UVI from crashing during initialization.
- Fixed _UVI Plugsound Free_ crashing during initialization.
## [3.1.0] - 2021-04-15
+24 -4
View File
@@ -490,13 +490,33 @@ class HostCallbackDataConverter : DefaultDataConverter {
case audioMasterGetProductString:
return WantsString{};
break;
// HACK: DefaultDataConverter::read() should be able to handle all
// NOTE: DefaultDataConverter::read() should be able to handle all
// of these 'simple' opcodes, but Plugsound Free by UVI passes
// random garbage for their data argument, which we would then
// try to read as a string resulting in a memory error.
// random garbage for their data argument. Because of that
// `audioMasterWantMidi()` will segfault because when we'll
// try to read that data as a string we'll start reading
// unallocated memory. Even though no other plugins seem to do
// this< we'll list all of these data-less opcodes just to be
// sure. We're leaving out a few opcodes here, because I have
// no clue whether some of the more obscure ones are supposed
// to have an data argument or not.
case audioMasterAutomate:
case audioMasterVersion:
case audioMasterCurrentId:
case audioMasterIdle:
case audioMasterWantMidi:
case audioMasterSizeWindow:
case audioMasterGetSampleRate:
case audioMasterGetBlockSize:
case audioMasterWantMidi:
case audioMasterGetInputLatency:
case audioMasterGetOutputLatency:
case audioMasterGetCurrentProcessLevel:
case audioMasterGetAutomationState:
case audioMasterGetVendorVersion:
case audioMasterGetLanguage:
case audioMasterUpdateDisplay:
case audioMasterBeginEdit:
case audioMasterEndEdit:
return nullptr;
break;
default: