Skip to content
Merged
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
6 changes: 3 additions & 3 deletions IccProfLib/IccMpeBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4632,7 +4632,7 @@ bool CIccMpeToneMap::Write(CIccIO* pIO)
icPositionNumber lumPos;
lumPos.offset = (icUInt32Number)(pIO->Tell()- nTagStartPos);

if (!m_pLumCurve->Write(pIO))
if (!m_pLumCurve || !m_pLumCurve->Write(pIO))
return false;

lumPos.size = (icUInt32Number)(pIO->Tell() - (lumPos.offset + nTagStartPos));
Expand All @@ -4642,7 +4642,7 @@ bool CIccMpeToneMap::Write(CIccIO* pIO)

//write out first tone function
funcPos[0].offset = (icUInt32Number)(pIO->Tell() - nTagStartPos);
if (!m_pToneFuncs[0]->Write(pIO)) {
if (!m_pToneFuncs[0] || !m_pToneFuncs[0]->Write(pIO)) {
return false;
}
funcPos[0].size = (icUInt32Number)(pIO->Tell() - (funcPos[0].offset + nTagStartPos));
Expand All @@ -4658,7 +4658,7 @@ bool CIccMpeToneMap::Write(CIccIO* pIO)
}
else {
funcPos[i].offset = (icUInt32Number)(pIO->Tell() - nTagStartPos);
if (!m_pToneFuncs[i]->Write(pIO)) {
if (!m_pToneFuncs[i] || !m_pToneFuncs[i]->Write(pIO)) {
return false;
}
funcPos[i].size = (icUInt32Number)(pIO->Tell() - (funcPos[i].offset + nTagStartPos));
Expand Down
2 changes: 2 additions & 0 deletions IccXML/IccLibXML/IccMpeXml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,7 @@ bool CIccMpeXmlToneMap::ParseXml(xmlNode* pNode, std::string& parseStr)
}
else {
parseStr += "Missing Luminance Curve";
return false;
}

pSubNode = icXmlFindNode(pNode->children, "ToneMapFunctions");
Expand Down Expand Up @@ -1872,6 +1873,7 @@ bool CIccMpeXmlToneMap::ParseXml(xmlNode* pNode, std::string& parseStr)
}
if (nIndex < m_nOutputChannels) {
parseStr += "Missing ToneMap Functions\n";
return false;
}
}

Expand Down
Loading