Skip to content

Commit cf28ef4

Browse files
authored
Fix: HUAF in CIccCmm::AddXform() (#616)
Signed-off-by: David Hoyt <dhoyt@hoyt.net>
1 parent 43ae18d commit cf28ef4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

IccProfLib/IccCmm.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8309,6 +8309,11 @@ icStatusCMM CIccCmm::AddXform(CIccProfile *pProfile,
83098309
nIntent = icPerceptual;
83108310
}
83118311

8312+
// this must check before creating the Xform, because that can delete the profile
8313+
if (pProfile->m_Header.deviceClass == icSigMaterialVisualizationClass) {
8314+
bInput = true;
8315+
}
8316+
83128317
CIccXformPtr Xform;
83138318

83148319
Xform.ptr = CIccXform::Create(pProfile, bInput, nIntent, nInterp, pPcc, nLutType, bUseD2BxB2DxTags, pHintManager);
@@ -8317,10 +8322,6 @@ icStatusCMM CIccCmm::AddXform(CIccProfile *pProfile,
83178322
return icCmmStatBadXform;
83188323
}
83198324

8320-
if (pProfile->m_Header.deviceClass==icSigMaterialVisualizationClass) {
8321-
bInput = true;
8322-
}
8323-
83248325
m_nLastSpace = nDstSpace;
83258326
m_nLastParentSpace = nParentSpace;
83268327
m_nLastIntent = nIntent;

0 commit comments

Comments
 (0)