Skip to content

Commit

Permalink
Merge pull request #443 from x2018/cmsIOhandler
Browse files Browse the repository at this point in the history
Optimize cmsOpenIOhandlerFromMem() in 'w' mode
Looks great, thank you!
  • Loading branch information
mm2 authored Apr 17, 2024
2 parents fe8d383 + 6d36466 commit 83f650b
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 83f650b

Please sign in to comment.