diff --git a/src/cmsio0.c b/src/cmsio0.c index 75442e66..b04c28f3 100644 --- a/src/cmsio0.c +++ b/src/cmsio0.c @@ -277,6 +277,11 @@ cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buff fm = (FILEMEM*) _cmsMallocZero(ContextID, sizeof(FILEMEM)); if (fm == NULL) goto Error; + if (Buffer == NULL) { + cmsSignalError(ContextID, cmsERROR_WRITE, "Couldn't write profile to NULL pointer"); + goto Error; + } + fm ->Block = (cmsUInt8Number*) Buffer; fm ->FreeBlockOnClose = FALSE; fm ->Size = size;