Skip to content

Commit 5176347

Browse files
committed
Add a guard against a wrong use of flags
Fixes #471 Thanks for reporting!
1 parent 9b58846 commit 5176347

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

Projects/VC2022/fuzzers/fuzzers.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@
155155
</Link>
156156
</ItemDefinitionGroup>
157157
<ItemGroup>
158-
<ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj">
159-
<Project>{74e045a1-5ea1-4c83-85e9-9e6632db8cd1}</Project>
160-
</ProjectReference>
158+
<ClCompile Include="..\..\..\fuzzers\fuzzers.c" />
161159
</ItemGroup>
162160
<ItemGroup>
163-
<ClCompile Include="..\..\..\fuzzers\fuzzers.c" />
161+
<ProjectReference Include="..\lcms2_static\lcms2_static.vcxproj">
162+
<Project>{71dede59-3f1e-486b-a899-4283000f76b5}</Project>
163+
</ProjectReference>
164164
</ItemGroup>
165165
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
166166
<ImportGroup Label="ExtensionTargets">

fuzzers/fuzzers.exp

5.02 KB
Binary file not shown.

src/cmsps2.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,13 @@ cmsBool WriteOutputLUT(cmsIOHANDLER* m, cmsHPROFILE hProfile, cmsUInt32Number In
13511351

13521352
first = cmsPipelineGetPtrToFirstStage(DeviceLink);
13531353
if (first != NULL) {
1354+
if (first->Type != cmsSigCLutElemType) {
1355+
cmsPipelineFree(DeviceLink);
1356+
cmsDeleteTransform(xform);
1357+
cmsSignalError(m->ContextID, cmsERROR_CORRUPTION_DETECTED, "Cannot create CLUT, revise your flags!");
1358+
return FALSE;
1359+
}
1360+
13541361
WriteCLUT(m, first, "<", ">\n", "", "", lFixWhite, ColorSpace);
13551362
}
13561363

0 commit comments

Comments
 (0)