//
// WebPSafeCalloc from 0x946c98 to 0x946ce0 (72 bytes)
//
// 14 xrefs:
// > sub_9067C4 @ 0x9067ca
// > sub_9067EC @ 0x906834
// > WebPINewDecoder @ 0x908746
// > sub_90B5BC @ 0x90b5c6
// > sub_90D670 @ 0x90d708
// > sub_90E1E4 @ 0x90e1ee
// > sub_90E328 @ 0x90e33e
// > sub_934984 @ 0x9349ee
// > sub_9409A4 @ 0x940a26
// > sub_941580 @ 0x9415b0
// > sub_941580 @ 0x9418ec
// > sub_941580 @ 0x941e24
// > sub_944248 @ 0x94425a
// > sub_946B48 @ 0x946b8e
//
// 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:05:11 +0000
//
void *__fastcall WebPSafeCalloc(unsigned __int64 item_count, size_t item_size)
{
bool v3; // zf
if ( !item_count )
return j_calloc(item_count, item_size);
if ( 0x10000000000LL / item_count < item_size )
return nullptr;
v3 = (item_count * item_size) >> 32 == 0;
if ( is_mul_ok(item_count, item_size) )
v3 = 1;
if ( v3 )
return j_calloc(item_count, item_size);
else
return nullptr;
}