Add null terminator to audio device names when writing to the output buffer

This commit is contained in:
gdkchan 2018-04-26 11:34:40 -03:00
parent 81e74ebd86
commit 1af78416d1
2 changed files with 5 additions and 5 deletions

View file

@ -32,7 +32,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
int NameCount = 0;
byte[] DeviceNameBuffer = Encoding.UTF8.GetBytes(DefaultAudioOutput);
byte[] DeviceNameBuffer = Encoding.ASCII.GetBytes(DefaultAudioOutput + "\0");
if ((ulong)DeviceNameBuffer.Length <= (ulong)Size)
{
@ -67,7 +67,7 @@ namespace Ryujinx.Core.OsHle.Services.Aud
long Position = Context.Request.ReceiveBuff[0].Position;
long Size = Context.Request.ReceiveBuff[0].Size;
byte[] DeviceNameBuffer = Encoding.UTF8.GetBytes(DeviceName);
byte[] DeviceNameBuffer = Encoding.ASCII.GetBytes(DeviceName + "\0");
if ((ulong)DeviceNameBuffer.Length <= (ulong)Size)
{