mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-06 00:29:06 +02:00
Reject texture descriptors with unmapped addresses
Fix an "Invalid texture format 0x25A5A (sRGB: True)" error that occurs when running OCTOPATH TRAVELER 0. The game may leave texture descriptor heap entries filled with 0x5A. Interpreting such uninitialized entries as valid texture descriptors produces an invalid format and causes texture creation to proceed with garbage descriptor data. Validate the texture address before decoding the descriptor. Descriptors with a zero or unmapped address are marked as invalid and skipped. The invalid state is cleared when the corresponding texture pool entry is modified, allowing the descriptor to be evaluated again.
This commit is contained in:
@@ -185,6 +185,16 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
// A pool index may point at an uninitialized guest heap slot. Validate the
|
||||
// descriptor address before decoding format, dimensions, or layout fields.
|
||||
ulong address = descriptor.UnpackAddress();
|
||||
|
||||
if (address == 0 || !_channel.MemoryManager.IsMapped(address))
|
||||
{
|
||||
_invalidMap.Set(id);
|
||||
return ref descriptor;
|
||||
}
|
||||
|
||||
if (_invalidMap.IsSet(id))
|
||||
{
|
||||
return ref descriptor;
|
||||
|
||||
Reference in New Issue
Block a user