decklink: Fix string handling causing plugin to not function
Some checks are pending
Push / Format 🔍 (push) Waiting to run
Push / Build 🧱 (push) Waiting to run
Push / Validate Compatibility 🕵️ (push) Waiting to run
Push / Validate Services 🕵️ (push) Waiting to run
Push / Update Documentation 📖 (push) Waiting to run
Push / Deploy Documentation to Cloudflare ☁️ (push) Blocked by required conditions
Push / Create Sparkle Appcast 🎙️ (arm64) (push) Blocked by required conditions
Push / Create Sparkle Appcast 🎙️ (x86_64) (push) Blocked by required conditions
Push / merge-appcasts (push) Blocked by required conditions
Push / Windows Signing ✍️ (push) Blocked by required conditions
Push / Create Release 🛫 (push) Blocked by required conditions

This commit is contained in:
Marco 2024-11-16 13:49:07 +01:00 committed by Ryan Foster
parent 4652daf748
commit 7722698c7c

View File

@ -1,6 +1,7 @@
#include "../platform.hpp"
#include <util/platform.h>
#include <comdef.h>
IDeckLinkDiscovery *CreateDeckLinkDiscoveryInstance(void)
{
@ -31,11 +32,10 @@ bool DeckLinkStringToStdString(decklink_string_t input, std::string &output)
if (input == nullptr)
return false;
size_t len = wcslen(input);
size_t utf8_len = os_wcs_to_utf8(input, len, nullptr, 0);
char *out = _com_util::ConvertBSTRToString(input);
output = std::string(out);
output.resize(utf8_len);
os_wcs_to_utf8(input, len, &output[0], utf8_len);
delete[] out;
return true;
}