//
// TIFFCheckTile from 0x6f2488 to 0x6f2634 (428 bytes)
//
// 3 xrefs:
// > TIFFReadTile @ 0x6eead8
// > TIFFWriteTile @ 0x6f3ec0
// > ??> @ 0x587ac
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall TIFFCheckTile(int a1, unsigned int a2, unsigned int a3, unsigned int a4, unsigned __int16 a5)
{
if ( *(_DWORD *)(a1 + 56) > a2 )
{
if ( *(_DWORD *)(a1 + 60) > a3 )
{
if ( *(_DWORD *)(a1 + 64) > a4 )
{
if ( *(_WORD *)(a1 + 126) == 2 && a5 >= (unsigned int)*(unsigned __int16 *)(a1 + 98) )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
*(_DWORD *)a1,
"%lu: Sample out of range, max %lu",
a5,
*(unsigned __int16 *)(a1 + 98) - 1);
return 0;
}
else
{
return 1;
}
}
else
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
*(_DWORD *)a1,
"%lu: Depth out of range, max %lu",
a4,
*(_DWORD *)(a1 + 64) - 1);
return 0;
}
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), *(_DWORD *)a1, "%lu: Row out of range, max %lu", a3, *(_DWORD *)(a1 + 60) - 1);
return 0;
}
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), *(_DWORD *)a1, "%lu: Col out of range, max %lu", a2, *(_DWORD *)(a1 + 56) - 1);
return 0;
}
}