//
// png_set_gray_to_rgb from 0xbd877c to 0xbd87d0 (84 bytes)
//
// 4 xrefs:
// > cocos2d::CCImage::_initWithPngData @ 0xb0c00c
// > png_read_row @ 0xbd42c0
// > png_read_png @ 0xbd605c
// > ??> @ 0x74490
//
// 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_set_gray_to_rgb(__int64 result)
{
int v1; // w2
__int64 v2; // x19
if ( result )
{
v1 = *(_DWORD *)(result + 360);
if ( (v1 & 0x40) != 0 )
{
return png_app_error(result, "invalid after png_start_read_image or png_read_update_info");
}
else
{
v2 = result;
*(_DWORD *)(result + 360) = v1 | 0x4000;
png_set_expand_gray_1_2_4_to_8(result);
result = *(_DWORD *)(v2 + 364) | 0x4000u;
*(_DWORD *)(v2 + 364) = result;
}
}
return result;
}