瀏覽代碼

Fix a memory corruption in SoundIO wrapper (#742)

This fix audio slowdown on Unix based platforms where soundio will try
to switch to mono because of the invalid data written.
Thomas Guillemard 6 年之前
父節點
當前提交
5c44c9600f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Ryujinx.Audio/Native/libsoundio/SoundIOOutStream.cs

+ 1 - 1
Ryujinx.Audio/Native/libsoundio/SoundIOOutStream.cs

@@ -64,7 +64,7 @@ namespace SoundIOSharp
 			get { unsafe { return new SoundIOChannelLayout ((IntPtr) ((void*) ((IntPtr) handle + layout_offset))); } }
 			set {
 				unsafe {
-					Buffer.MemoryCopy ((void*)((IntPtr)handle + layout_offset), (void*)value.Handle,
+					Buffer.MemoryCopy ((void*)value.Handle, (void*)((IntPtr)handle + layout_offset),
 							   Marshal.SizeOf<SoundIoChannelLayout> (), Marshal.SizeOf<SoundIoChannelLayout> ());
 				}
 			}