diff --git a/renderdocui/Interop/CustomMarshaling.cs b/renderdocui/Interop/CustomMarshaling.cs index 365151210..1e711e6d6 100644 --- a/renderdocui/Interop/CustomMarshaling.cs +++ b/renderdocui/Interop/CustomMarshaling.cs @@ -403,7 +403,8 @@ namespace renderdoc public static string PtrToStringUTF8(IntPtr elems, int count) { byte[] buffer = new byte[count]; - Marshal.Copy(elems, buffer, 0, buffer.Length); + if (count > 0) + Marshal.Copy(elems, buffer, 0, buffer.Length); return System.Text.Encoding.UTF8.GetString(buffer); }