diff options
author | Ac_K <Acoustik666@gmail.com> | 2023-06-01 18:24:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 18:24:00 +0200 |
commit | b8f48bcf640acae519602a26fd6c4ce49c04709b (patch) | |
tree | c411901f99d7c064e5b26bef3ddef5cd3b4e93f7 /src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs | |
parent | 6966211e0723685ccf1895e34e3c9e93c52fbb52 (diff) |
UI: Fix empty homebrew icon (#5189)1.1.854
* UI: Fix empty homebrew icon
We currently don't check the icon size when we read it from the homebrew data. That could cause issues at UI side since the buffer isn't null but empty. Extra check have been added UI side too.
(I cleaned up some files during my research too)
Fixes #5188
* Remove additional check
* Remove unused using
Diffstat (limited to 'src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs')
-rw-r--r-- | src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs index 0407036a..f52af611 100644 --- a/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.Ui.Common/App/ApplicationLibrary.cs @@ -343,7 +343,14 @@ namespace Ryujinx.Ui.App.Common ulong nacpSize = reader.ReadUInt64(); // Reads and stores game icon as byte array - applicationIcon = Read(assetOffset + iconOffset, (int)iconSize); + if (iconSize > 0) + { + applicationIcon = Read(assetOffset + iconOffset, (int)iconSize); + } + else + { + applicationIcon = _nroIcon; + } // Read the NACP data Read(assetOffset + (int)nacpOffset, (int)nacpSize).AsSpan().CopyTo(controlHolder.ByteSpan); @@ -666,7 +673,14 @@ namespace Ryujinx.Ui.App.Common long iconSize = BitConverter.ToInt64(iconSectionInfo, 8); // Reads and stores game icon as byte array - applicationIcon = Read(assetOffset + iconOffset, (int)iconSize); + if (iconSize > 0) + { + applicationIcon = Read(assetOffset + iconOffset, (int)iconSize); + } + else + { + applicationIcon = _nroIcon; + } } else { |