summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-03-29 12:43:33 +0000
committerRobin Watts <robin.watts@artifex.com>2013-03-29 19:26:11 +0000
commit41d222df1bc6188131a8f46c32eab0a4d4cdf1b6 (patch)
tree2d2c2e01aa2218836088530d7d90523a9827cde4 /include
parentb0d5ffd4ad91cf8683ee106f13742db3dc66599a (diff)
downloadlcms2-41d222df1bc6188131a8f46c32eab0a4d4cdf1b6.tar.gz
Memory squeezing fix: lcms2 cmsPipeline construction
When creating a new pipeline, lcms would often try to allocate a stage and pass it to cmsPipelineInsertStage without checking whether the allocation succeeded. cmsPipelineInsertStage would then assert (or crash) if it had not. The fix here is to change cmsPipelineInsertStage to check and return an error value. All calling code is then checked to test this return value and cope.
Diffstat (limited to 'include')
-rw-r--r--include/lcms2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/lcms2.h b/include/lcms2.h
index 887bb37..4eb553e 100644
--- a/include/lcms2.h
+++ b/include/lcms2.h
@@ -1163,7 +1163,7 @@ CMSAPI cmsBool CMSEXPORT cmsPipelineSetSaveAs8bitsFlag(cmsPipeline* lu
// Where to place/locate the stages in the pipeline chain
typedef enum { cmsAT_BEGIN, cmsAT_END } cmsStageLoc;
-CMSAPI void CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe);
+CMSAPI int CMSEXPORT cmsPipelineInsertStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage* mpe);
CMSAPI void CMSEXPORT cmsPipelineUnlinkStage(cmsPipeline* lut, cmsStageLoc loc, cmsStage** mpe);
// This function is quite useful to analyze the structure of a Pipeline and retrieve the Stage elements