From 959457c0de174de5ada2ee77083a0c2a6750fc12 Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Fri, 3 Jun 2011 13:06:22 +0200 Subject: Fixed a bug in ReadRawTag --- AUTHORS | 1 + ChangeLog | 1 + src/cmsio0.c | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index eb1d66d..13c7f63 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ Chris Evans Lorenzo Ridolfi Robin Watts Shawn Pedersen +Andrew Brygin Special Thanks -------------- diff --git a/ChangeLog b/ChangeLog index ffb63ec..0347e13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,7 @@ Fixed a bug that made crash black preservation on CMYK2CMYK devicelinks Added named color functionality Fixed a bug in black preservation and sligtly non-monotonic curves Added dictionary metatag support +Fixed a bug on ReadRAWtag 2.2 Maintenance release diff --git a/src/cmsio0.c b/src/cmsio0.c index 770e986..5fb542e 100644 --- a/src/cmsio0.c +++ b/src/cmsio0.c @@ -1460,7 +1460,10 @@ cmsBool CMSEXPORT cmsWriteTag(cmsHPROFILE hProfile, cmsTagSignature sig, const v if (data == NULL) { - cmsSignalError(cmsGetProfileContextID(hProfile), cmsERROR_NULL, "couldn't wite NULL to tag"); + i = _cmsSearchTag(Icc, sig, FALSE); + if (i >= 0) + Icc ->TagNames[i] = (cmsTagSignature) 0; + // Unsupported by now, reserved for future ampliations (delete) return FALSE; } @@ -1656,6 +1659,12 @@ cmsInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature sig // Serialize TypeHandler ->ContextID = Icc ->ContextID; TypeHandler ->ICCVersion = Icc ->Version; + + if (!_cmsWriteTypeBase(MemIO, TypeHandler ->Signature)) { + cmsCloseIOhandler(MemIO); + return 0; + } + if (!TypeHandler ->WritePtr(TypeHandler, MemIO, Object, TagDescriptor ->ElemCount)) { cmsCloseIOhandler(MemIO); return 0; -- cgit v1.2.3