Skip to content

Commit

Permalink
Fixed a bug in ReadRawTag
Browse files Browse the repository at this point in the history
  • Loading branch information
mm2 committed Jun 3, 2011
1 parent a3fe774 commit 959457c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Chris Evans
Lorenzo Ridolfi
Robin Watts
Shawn Pedersen
Andrew Brygin

Special Thanks
--------------
Expand Down
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/cmsio0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 959457c

Please sign in to comment.