//
// sub_6A2E4C from 0x6a2e4c to 0x6a2f24 (216 bytes)
//
// 9 xrefs:
// > _TIFFsetByteArray @ 0x6a2f4c
// > _TIFFsetString @ 0x6a2f90
// > _TIFFsetNString @ 0x6a2fc8
// > _TIFFsetShortArray @ 0x6a3000
// > _TIFFsetLongArray @ 0x6a3038
// > _TIFFsetLong8Array @ 0x6a3070
// > _TIFFsetFloatArray @ 0x6a30a8
// > _TIFFsetDoubleArray @ 0x6a30e0
// > sub_6A344C @ 0x6a4868
//
// 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 sub_6A2E4C(int result, int a2, int a3, unsigned int a4)
{
int *v7; // [sp+Ch] [bp-10h]
unsigned int v8; // [sp+14h] [bp-8h]
v7 = (int *)result;
if ( *(_DWORD *)result )
{
result = TIFFfree(*(_DWORD *)result);
*v7 = 0;
}
if ( a2 )
{
v8 = a4 * a3;
if ( a4 )
{
result = v8 / a4;
if ( v8 / a4 == a3 )
{
result = TIFFmalloc(v8);
*v7 = result;
}
}
if ( *v7 )
return TIFFmemcpy(*v7, a2, v8);
}
return result;
}