Redundantly limit number of drag-and-drop formats

As reported in #149, the DrumCore 3 plugin would segfault when trying to
drag files from it. This happened because the plugin presumably
underflows somewhere and then reports that it supports 4294967282
different drag-and-drop formats, even though yabridge asked for a
maximum of 16.
This commit is contained in:
Robbert van der Helm
2021-12-16 01:52:37 +01:00
parent 7ddcd5c315
commit d48dbe71da
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -20,6 +20,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
when the GUI changes. Yabridge now detects this, and removes the throttling we
have in place to prevent certain other plugins from getting stuck in infinite
loops.
- Fixed **DrumCore 3** crashing when trying to drag grooves from the plugin to
other applications. This happened because of an integer underflow in that
plugin, causing the number of reported drag-and-drop formats to be magnitudes
higher than yabridge's indicated maximum.
- Fixed Wine version detection in the build configuration.
## [3.7.0] - 2021-11-21
+5
View File
@@ -790,6 +790,11 @@ void CALLBACK dnd_winevent_callback(HWINEVENTHOOK /*hWinEventHook*/,
&num_formats);
enumerator->Release();
// NOTE: This DrumCore 3 plugin reports 4294967282 for `num_formats` which
// is uh a lot more than 16. So to prevent causing a segfault here we
// need to manually cap `num_formats` to 16.
num_formats = std::min(num_formats, static_cast<unsigned int>(16));
// NOTE: MeldaProduction plugins don't return any supported formats for some
// reason, so we'll hardcode a HDROP
if (num_formats == 0) {