//
// png_icc_check_length from 0x85dcc0 to 0x85ddc4 (260 bytes)
//
// 2 xrefs:
// > png_colorspace_set_ICC @ 0x8603ea
// > png_handle_iCCP @ 0x86d2d0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:02:41 +0000
//
int __fastcall png_icc_check_length(int a1, int a2, int a3, unsigned int a4)
{
int v8; // r0
int v9; // r0
int v10; // r5
int v11; // r0
int v12; // r0
int v13; // r0
int v14; // r2
int v15; // r0
int v16; // r0
int v17; // r5
int v18; // r0
int v19; // r0
int v20; // r0
_BYTE v21[24]; // [sp+4h] [bp-FCh] BYREF
_BYTE v22[228]; // [sp+1Ch] [bp-E4h] BYREF
if ( a4 > 0x83 )
return 1;
if ( a2 )
{
*(_WORD *)(a2 + 74) = ~((unsigned int)~(*(unsigned __int16 *)(a2 + 74) << 17) >> 17);
v8 = png_safecat(v22, 196, 0, "profile '");
v9 = png_safecat(v22, v8 + 79, v8, a3);
v10 = png_safecat(v22, 196, v9, "': ");
v11 = png_format_number(v21, v22, 3, a4);
v12 = png_safecat(v22, 196, v10, v11);
v13 = png_safecat(v22, 196, v12, "h: ");
png_safecat(v22, 196, v13, "too short");
v14 = 2;
}
else
{
v15 = png_safecat(v22, 196, 0, "profile '");
v16 = png_safecat(v22, v15 + 79, v15, a3);
v17 = png_safecat(v22, 196, v16, "': ");
v18 = png_format_number(v21, v22, 3, a4);
v19 = png_safecat(v22, 196, v17, v18);
v20 = png_safecat(v22, 196, v19, "h: ");
png_safecat(v22, 196, v20, "too short");
v14 = 1;
}
png_chunk_report(a1, v22, v14);
return 0;
}