Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cmscgats.c
Original file line number Diff line number Diff line change
Expand Up @@ -3253,11 +3253,13 @@ cmsHPROFILE CMSEXPORT cmsCreateDeviceLinkFromCubeFileTHR(cmsContext ContextID, c
if (Shaper != NULL) {
if (!cmsPipelineInsertStage(Pipeline, cmsAT_BEGIN, Shaper))
goto Done;
Shaper = NULL;
}

if (CLUT != NULL) {
if (!cmsPipelineInsertStage(Pipeline, cmsAT_END, CLUT))
goto Done;
CLUT = NULL;
}

// Propagate the description. We put no copyright because we know
Expand All @@ -3270,6 +3272,11 @@ cmsHPROFILE CMSEXPORT cmsCreateDeviceLinkFromCubeFileTHR(cmsContext ContextID, c
if (!cmsWriteTag(hProfile, cmsSigAToB0Tag, (void*)Pipeline)) goto Done;

Done:
if (CLUT != NULL)
cmsStageFree(CLUT);

if (Shaper != NULL)
cmsStageFree(Shaper);

if (DescriptionMLU != NULL)
cmsMLUfree(DescriptionMLU);
Expand Down
4 changes: 4 additions & 0 deletions src/cmslut.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,11 @@ int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage
cmsStage* Anterior = NULL, *pt;

if (lut == NULL || mpe == NULL)
{
if (mpe)
cmsStageFree(mpe);
return FALSE;
}

switch (loc) {

Expand Down