//
// png_icc_check_length from 0xbc68d4 to 0xbc6abc (488 bytes)
//
// 3 xrefs:
// > png_colorspace_set_ICC @ 0xbca31c
// > png_handle_iCCP @ 0xbdfef8
// > ??> @ 0xa7f70
//
// 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
//
__int64 __fastcall png_icc_check_length(__int64 a1, __int64 a2, __int64 a3, unsigned int a4)
{
unsigned int v4; // w20
__int64 v8; // x21
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x20
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x2
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x23
__int64 v19; // x0
__int64 v20; // x0
__int64 v21; // x0
_BYTE v22[24]; // [xsp+48h] [xbp+48h] BYREF
_BYTE v23[200]; // [xsp+60h] [xbp+60h] BYREF
v4 = 1;
if ( a4 <= 0x83 )
{
v8 = a4;
if ( a2 )
{
*(_WORD *)(a2 + 74) |= 0x8000u;
v9 = png_safecat(v23, 196, 0, "profile '");
v10 = png_safecat(v23, v9 + 79, v9, a3);
v11 = png_safecat(v23, 196, v10, "': ");
v12 = png_format_number(v22, v23, 3, v8);
v13 = png_safecat(v23, 196, v11, v12);
v14 = png_safecat(v23, 196, v13, "h: ");
png_safecat(v23, 196, v14, "too short");
v15 = 2;
}
else
{
v16 = png_safecat(v23, 196, 0, "profile '");
v17 = png_safecat(v23, v16 + 79, v16, a3);
v18 = png_safecat(v23, 196, v17, "': ");
v19 = png_format_number(v22, v23, 3, v8);
v20 = png_safecat(v23, 196, v18, v19);
v21 = png_safecat(v23, 196, v20, "h: ");
png_safecat(v23, 196, v21, "too short");
v15 = 1;
}
v4 = 0;
png_chunk_report(a1, v23, v15);
}
return v4;
}