mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-03 17:15:47 +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);
|
assert(string_ref);
|
||||||
|
|
||||||
CFIndex length = CFStringGetLength(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);
|
char *buf = ALLOCATE_NONZERO(char, max_size);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return SoundIoErrorNoMem;
|
return SoundIoErrorNoMem;
|
||||||
|
|
Loading…
Reference in a new issue