decklink: Fix broken COM string conversion
authorSeungha Yang <seungha@centricular.com>
Mon, 9 Oct 2023 10:09:15 +0000 (19:09 +0900)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 9 Oct 2023 14:34:44 +0000 (15:34 +0100)
commit019430949cdee4b1e8407927789b0c11c53b6a18
tree8d464b6d6d335fab9e64a8c06473bbf9bef4804e
parent51e6209d1ca93927520a1f7720c38ec330c25cc8
decklink: Fix broken COM string conversion

WideCharToMultiByte return is the string length without null terminate
character if passed "cchWideChar" does not include the null terminate
character size. Instead of passing the exact string length, pass -1 so that
the API can understand the input string is null terminated already and
returned value from the API includes the character.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3023
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5446>
subprojects/gst-plugins-bad/sys/decklink/gstdecklink.h