//
// png_image_begin_read_from_stdio from 0xbd6158 to 0xbd61e8 (144 bytes)
//
// 1 xrefs:
// > ??> @ 0xa45c8
//
// 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_image_begin_read_from_stdio(__int64 a1, __int64 a2)
{
const char *v2; // x1
if ( !a1 )
return 0;
if ( *(_DWORD *)(a1 + 8) != 1 )
{
v2 = "png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION";
return png_image_error(a1, (__int64)v2);
}
if ( !a2 )
{
v2 = "png_image_begin_read_from_stdio: invalid argument";
return png_image_error(a1, (__int64)v2);
}
if ( !(unsigned int)sub_BD5DF0((_QWORD *)a1) )
return 0;
*(_QWORD *)(**(_QWORD **)a1 + 320LL) = a2;
return png_safe_execute(a1, sub_BD3718, a1);
}