summaryrefslogtreecommitdiff
path: root/testbed
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2022-07-24 21:58:42 +0200
committerMarti Maria <marti.maria@littlecms.com>2022-07-24 21:58:42 +0200
commit3d3001f0118984570a162d0b239d739529920e12 (patch)
treec1fe4efcf1d8e1fb347205065cea7de97b3f33eb /testbed
parent89c9d176b4349367ecd45f85b94aea3bf6f372c9 (diff)
downloadlcms2-3d3001f0118984570a162d0b239d739529920e12.tar.gz
Get rid of an undocumented feature
Which was abused by Fuzzer. since it was not documented now it is gone.
Diffstat (limited to 'testbed')
-rw-r--r--testbed/testcms2.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/testbed/testcms2.c b/testbed/testcms2.c
index 02a9a7b..de753d2 100644
--- a/testbed/testcms2.c
+++ b/testbed/testcms2.c
@@ -7834,41 +7834,41 @@ cmsInt32Number CheckFloatSegments(void)
static
cmsInt32Number CheckReadRAW(void)
{
- cmsInt32Number tag_size, tag_size1;
- char buffer[4];
- cmsHPROFILE hProfile;
-
+ cmsInt32Number tag_size, tag_size1;
+ char buffer[37009];
+ cmsHPROFILE hProfile;
- SubTest("RAW read on on-disk");
- hProfile = cmsOpenProfileFromFile("test1.icc", "r");
- if (hProfile == NULL)
- return 0;
-
- tag_size = cmsReadRawTag(hProfile, cmsSigGamutTag, buffer, 4);
- tag_size1 = cmsReadRawTag(hProfile, cmsSigGamutTag, NULL, 0);
+ SubTest("RAW read on on-disk");
+ hProfile = cmsOpenProfileFromFile("test1.icc", "r");
- cmsCloseProfile(hProfile);
+ if (hProfile == NULL)
+ return 0;
+ tag_size1 = cmsReadRawTag(hProfile, cmsSigGamutTag, NULL, 0);
+ tag_size = cmsReadRawTag(hProfile, cmsSigGamutTag, buffer, 37009);
- if (tag_size != 4)
- return 0;
- if (tag_size1 != 37009)
- return 0;
+ cmsCloseProfile(hProfile);
- SubTest("RAW read on in-memory created profiles");
- hProfile = cmsCreate_sRGBProfile();
- tag_size = cmsReadRawTag(hProfile, cmsSigGreenColorantTag, buffer, 4);
- tag_size1 = cmsReadRawTag(hProfile, cmsSigGreenColorantTag, NULL, 0);
+ if (tag_size != 37009)
+ return 0;
- cmsCloseProfile(hProfile);
+ if (tag_size1 != 37009)
+ return 0;
- if (tag_size != 4)
- return 0;
- if (tag_size1 != 20)
- return 0;
+ SubTest("RAW read on in-memory created profiles");
+ hProfile = cmsCreate_sRGBProfile();
+ tag_size1 = cmsReadRawTag(hProfile, cmsSigGreenColorantTag, NULL, 0);
+ tag_size = cmsReadRawTag(hProfile, cmsSigGreenColorantTag, buffer, 20);
- return 1;
+ cmsCloseProfile(hProfile);
+
+ if (tag_size != 20)
+ return 0;
+ if (tag_size1 != 20)
+ return 0;
+
+ return 1;
}
@@ -9458,7 +9458,7 @@ int main(int argc, char* argv[])
Check("Parametric curve on Rec709", CheckParametricRec709);
Check("Floating Point sampled curve with non-zero start", CheckFloatSamples);
Check("Floating Point segmented curve with short sampled segment", CheckFloatSegments);
- Check("Read RAW portions", CheckReadRAW);
+ Check("Read RAW tags", CheckReadRAW);
Check("Check MetaTag", CheckMeta);
Check("Null transform on floats", CheckFloatNULLxform);
Check("Set free a tag", CheckRemoveTag);