Skip to content

Commit

Permalink
Let the IOhandler successfully created by cmsOpenIOhandlerFromMem alw…
Browse files Browse the repository at this point in the history
…ays has a valid Block
  • Loading branch information
x2018 committed Apr 13, 2024
1 parent 6491e2e commit 6d36466
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmsio0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6d36466

Please sign in to comment.