//
// png_set_compression_buffer_size from 0xbe50a4 to 0xbe514c (168 bytes)
//
// 1 xrefs:
// > ??> @ 0x4f878
//
// 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
//
_DWORD *__fastcall png_set_compression_buffer_size(_DWORD *result, unsigned __int64 a2)
{
_DWORD *v2; // x19
int v3; // w20
const char *v4; // x1
v2 = result;
v3 = a2;
if ( result )
{
if ( a2 - 1 > 0x7FFFFFFE )
png_error((__int64)result, "invalid compression buffer size");
if ( (result[89] & 0x8000) != 0 )
{
result[312] = a2;
return result;
}
if ( result[92] )
{
v4 = "Compression buffer size cannot be changed because it is in use";
}
else
{
if ( a2 > 5 )
{
if ( a2 != result[124] )
{
result = (_DWORD *)png_free_buffer_list(result, result + 122);
v2[124] = v3;
}
return result;
}
v4 = "Compression buffer size cannot be reduced below 6";
}
return (_DWORD *)png_warning((__int64)result, v4);
}
return result;
}