Fixed some issues.

This commit is contained in:
cake
2026-01-20 00:25:26 +01:00
parent cff866dcc2
commit 22fe9901a4

View File

@@ -178,18 +178,14 @@ public sealed class GameObjectHandler : DisposableMediatorSubscriberBase, IHighP
var prevDrawObj = DrawObjectAddress;
string? nameString = null;
// Resolve address and validate BEFORE first deref
var nextAddr = _getAddress();
// Optional: catch the root cause quickly
// if nextAddr is 32-bit-ish, you're being fed an id/sentinel
if (nextAddr != IntPtr.Zero && !PtrGuard.LooksLikePtr(nextAddr))
{
Logger.LogWarning("[{this}] _getAddress returned non-pointer: 0x{addr:X}", this, (ulong)nextAddr);
nextAddr = IntPtr.Zero;
}
// Must be readable at least for a GameObject header before touching it
if (nextAddr != IntPtr.Zero &&
!PtrGuard.IsReadable(nextAddr, (nuint)sizeof(FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject)))
{