mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2024-12-22 13:35:37 +00:00
Fix inability to open CoreAudio device if it contains non-ASCII characters
This commit is contained in:
parent
2bb21ad417
commit
e0f0f6a7a2
|
@ -179,7 +179,7 @@ static int from_cf_string(CFStringRef string_ref, char **out_str, int *out_str_l
|
|||
assert(string_ref);
|
||||
|
||||
CFIndex length = CFStringGetLength(string_ref);
|
||||
CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
|
||||
CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1;
|
||||
char *buf = ALLOCATE_NONZERO(char, max_size);
|
||||
if (!buf)
|
||||
return SoundIoErrorNoMem;
|
||||
|
|
Loading…
Reference in a new issue