diff --git a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c index 76b14238bf7..80bc2853870 100644 --- a/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c +++ b/jdk/src/share/native/sun/java2d/cmm/lcms/cmslut.c @@ -1021,6 +1021,7 @@ cmsStage* _cmsStageAllocLabV2ToV4curves(cmsContext ContextID) mpe = cmsStageAllocToneCurves(ContextID, 3, LabTable); cmsFreeToneCurveTriple(LabTable); + if (mpe == NULL) return mpe; mpe ->Implements = cmsSigLabV2toV4; return mpe; } @@ -1424,6 +1425,8 @@ cmsPipeline* CMSEXPORT cmsPipelineDup(const cmsPipeline* lut) if (lut == NULL) return NULL; NewLUT = cmsPipelineAlloc(lut ->ContextID, lut ->InputChannels, lut ->OutputChannels); + if (NewLUT == NULL) return NULL; + for (mpe = lut ->Elements; mpe != NULL; mpe = mpe ->Next) {