mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-28 03:16:23 +02:00
Fix crash with if image data is over 4mb and other VK changes
This commit is contained in:
parent
7025c32c4a
commit
e02037d9c3
5 changed files with 18 additions and 10 deletions
|
@ -1411,14 +1411,18 @@ public unsafe struct GameInfoNative
|
|||
|
||||
if (imageData == null || imageData.Length > 4096 * 4096)
|
||||
{
|
||||
throw new ArgumentException("Image data must not exceed 4 MB.");
|
||||
// throw new ArgumentException("Image data must not exceed 4 MB.");
|
||||
ImageSize = (uint)0;
|
||||
ImageData = null;
|
||||
}
|
||||
|
||||
ImageSize = (uint)imageData.Length;
|
||||
else
|
||||
{
|
||||
ImageSize = (uint)imageData.Length;
|
||||
|
||||
ImageData = (byte*)Marshal.AllocHGlobal(imageData.Length);
|
||||
ImageData = (byte*)Marshal.AllocHGlobal(imageData.Length);
|
||||
|
||||
Marshal.Copy(imageData, 0, (IntPtr)ImageData, imageData.Length);
|
||||
Marshal.Copy(imageData, 0, (IntPtr)ImageData, imageData.Length);
|
||||
}
|
||||
}
|
||||
|
||||
// Don't forget to free the allocated memory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue