blob: ce9e1bf5b607d45988eab9f72a90aa142c1dba58 [file] [log] [blame] [edit]
diff --git a/third_party/lcms/src/cmstypes.c b/third_party/lcms/src/cmstypes.c
index 941107e1a..f2119ae0a 100644
--- a/third_party/lcms/src/cmstypes.c
+++ b/third_party/lcms/src/cmstypes.c
@@ -3105,7 +3105,7 @@ void *Type_NamedColor_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* i
if (nDeviceCoords > cmsMAXCHANNELS) {
cmsSignalError(self->ContextID, cmsERROR_RANGE, "Too many device coordinates '%d'", nDeviceCoords);
- return 0;
+ goto Error;
}
for (i=0; i < count; i++) {
@@ -3114,7 +3114,7 @@ void *Type_NamedColor_Read(struct _cms_typehandler_struct* self, cmsIOHANDLER* i
char Root[33];
memset(Colorant, 0, sizeof(Colorant));
- if (io -> Read(io, Root, 32, 1) != 1) return NULL;
+ if (io -> Read(io, Root, 32, 1) != 1) goto Error;
Root[32] = 0; // To prevent exploits
if (!_cmsReadUInt16Array(io, 3, PCS)) goto Error;