mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-21 18:58:13 +00:00
GPU: Fix D3D12_INTERNAL_StrToWStr returning incorrect length
This commit is contained in:
@@ -3630,7 +3630,8 @@ static bool D3D12_INTERNAL_StrToWStr(
|
|||||||
Uint32 *outSize)
|
Uint32 *outSize)
|
||||||
{
|
{
|
||||||
size_t inlen, result;
|
size_t inlen, result;
|
||||||
size_t outlen = wstrSize;
|
size_t outBytesLeft = wstrSize;
|
||||||
|
*outSize = 0;
|
||||||
|
|
||||||
if (renderer->iconv == NULL) {
|
if (renderer->iconv == NULL) {
|
||||||
renderer->iconv = SDL_iconv_open("WCHAR_T", "UTF-8");
|
renderer->iconv = SDL_iconv_open("WCHAR_T", "UTF-8");
|
||||||
@@ -3644,9 +3645,8 @@ static bool D3D12_INTERNAL_StrToWStr(
|
|||||||
&str,
|
&str,
|
||||||
&inlen,
|
&inlen,
|
||||||
(char **)&wstr,
|
(char **)&wstr,
|
||||||
&outlen);
|
&outBytesLeft);
|
||||||
|
|
||||||
*outSize = (Uint32)outlen;
|
|
||||||
|
|
||||||
// Check...
|
// Check...
|
||||||
switch (result) {
|
switch (result) {
|
||||||
@@ -3660,6 +3660,7 @@ static bool D3D12_INTERNAL_StrToWStr(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*outSize = (Uint32)(wstrSize - outBytesLeft);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user