//
// TIFFReadRawStrip from 0x6ee368 to 0x6ee568 (512 bytes)
//
// 1 xrefs:
// > ??> @ 0x5879c
//
// 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 TIFFReadRawStrip(int a1, unsigned int a2, int a3, int a4)
{
int v10; // [sp+24h] [bp-18h]
__int64 v11; // [sp+28h] [bp-14h]
int v12; // [sp+34h] [bp-8h]
v10 = a1 + 40;
if ( !sub_6EFC84(a1, 0) )
return -1;
if ( *(_DWORD *)(v10 + 128) > a2 )
{
if ( (*(_DWORD *)(a1 + 12) & 0x20000) != 0 )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"TIFFReadRawStrip",
"Compression scheme does not support access to raw uncompressed data");
return -1;
}
else
{
v11 = *(_QWORD *)(*(_DWORD *)(v10 + 136) + 8 * a2);
if ( v11 )
{
v12 = *(_DWORD *)(*(_DWORD *)(v10 + 136) + 8 * a2);
if ( HIDWORD(v11) == (int)v11 >> 31 )
{
if ( a4 != -1 && a4 < (int)v11 )
v12 = a4;
return sub_6EE01C(a1, a2, a3, v12, (int)"TIFFReadRawStrip");
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"TIFFReadRawStrip", "Integer overflow");
return -1;
}
}
else
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"TIFFReadRawStrip",
"%llu: Invalid strip byte count, strip %lu",
0LL,
a2);
return -1;
}
}
}
else
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"TIFFReadRawStrip",
"%lu: Strip out of range, max %lu",
a2,
*(_DWORD *)(v10 + 128));
return -1;
}
}