Skip to content

Commit

Permalink
Add a guard against a wrong use of flags
Browse files Browse the repository at this point in the history
Fixes #471 Thanks for reporting!
  • Loading branch information
mm2 committed Feb 4, 2025
1 parent 9b58846 commit 5176347
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Projects/VC2022/fuzzers/fuzzers.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj">
<Project>{74e045a1-5ea1-4c83-85e9-9e6632db8cd1}</Project>
</ProjectReference>
<ClCompile Include="..\..\..\fuzzers\fuzzers.c" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\fuzzers\fuzzers.c" />
<ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj">
<Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
Binary file added fuzzers/fuzzers.exp
Binary file not shown.
7 changes: 7 additions & 0 deletions src/cmsps2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,13 @@ cmsBool WriteOutputLUT(cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsUInt32Number In

first = cmsPipelineGetPtrToFirstStage(DeviceLink);
if (first != NULL) {
if (first->Type != cmsSigCLutElemType) {
cmsPipelineFree(DeviceLink);
cmsDeleteTransform(xform);
cmsSignalError(m->ContextID, cmsERROR_CORRUPTION_DETECTED, "Cannot create CLUT, revise your flags!");
return FALSE;
}

WriteCLUT(m, first, "<", ">\n", "", "", lFixWhite, ColorSpace);
}

Expand Down

0 comments on commit 5176347

Please sign in to comment.