From 1274edf6499243c1c3e0f6b3f33fbd59307057fe Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 31 Aug 2022 19:35:51 +0200 Subject: [PATCH] Bail when loading incompatible CLAP plugins Based on the version. --- src/wine-host/bridges/clap.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/wine-host/bridges/clap.cpp b/src/wine-host/bridges/clap.cpp index f97da5db..68ce7008 100644 --- a/src/wine-host/bridges/clap.cpp +++ b/src/wine-host/bridges/clap.cpp @@ -56,6 +56,14 @@ ClapBridge::ClapBridge(MainContext& main_context, "' does not export the 'clap_entry' entry point."); } + if (!clap_version_is_compatible(entry_->clap_version)) { + throw std::runtime_error( + "" + plugin_dll_path + "' has an incompatible CLAP version (" + + std::to_string(entry_->clap_version.major) + "." + + std::to_string(entry_->clap_version.minor) + "." + + std::to_string(entry_->clap_version.revision) + ")."); + } + // CLAP plugins receive the library path in their init function. The problem // is that `plugin_dll_path` is a Linux path. This should be fine as all // Wine syscalls can work with both Windows and Linux style paths, but if