LCMS_INLINE void* _cmsCalloc(size_t nmemb, size_t size)
{
size_t alloc = nmemb * size;
if (alloc < nmemb || alloc < size) {
if (size == 0) {
return _cmsMalloc(0);
}
if (alloc / size != nmemb) {
return NULL;
return _cmsMalloc(alloc);
size_t len = size * count;
size_t extent = ResData -> Pointer + len;
if (len < size || len < count) {
if (len == 0) {
return 0;
if (len / size != count) {
cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Integer overflow with count / size.");
oldCalc = calc;
calc *= NewLUT -> cLutPoints;
if (calc < oldCalc || calc < NewLUT -> cLutPoints) {
if (calc / NewLUT -> cLutPoints != oldCalc) {
return FALSE;
calc *= NewLUT -> OutputChan;
if (calc < oldCalc || calc < NewLUT -> OutputChan) {
if (NewLUT -> OutputChan && calc / NewLUT -> OutputChan != oldCalc) {