diff options
author | Robin Watts <robin@peeves.(none)> | 2013-03-29 08:29:31 -0700 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-03-29 15:36:58 +0000 |
commit | 9cf2d61867375f867e6e80906a571d222bc2cbf3 (patch) | |
tree | b4c59b8d03bf83191622325b4dbe24625f3254da | |
parent | 049d634ea6bf2a9bafbf9ddef18464be9caa567f (diff) | |
download | lcms2-9cf2d61867375f867e6e80906a571d222bc2cbf3.tar.gz |
Memory squeezing fix: LCMS2: AllocateToneCurveStruct
Simply add an extra check on the last allocation to avoid returning a
partially built struct.
-rw-r--r-- | src/cmsgamma.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmsgamma.c b/src/cmsgamma.c index 7471d25..10ca600 100644 --- a/src/cmsgamma.c +++ b/src/cmsgamma.c @@ -229,7 +229,8 @@ cmsToneCurve* AllocateToneCurveStruct(cmsContext ContextID, cmsInt32Number nEntr } p ->InterpParams = _cmsComputeInterpParams(ContextID, p ->nEntries, 1, 1, p->Table16, CMS_LERP_FLAGS_16BITS); - return p; + if (p->InterpParams != NULL) + return p; Error: if (p -> Segments) _cmsFree(ContextID, p ->Segments); |