mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user