Merge performance fix for cmsDupToneCurve from previous upstream branch.

BUG=
R=jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/534363002
diff --git a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgamma.c b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgamma.c
index d5aa87b..97aeb7c 100644
--- a/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgamma.c
+++ b/core/src/fxcodec/lcms2/lcms2-2.6/src/cmsgamma.c
@@ -822,7 +822,7 @@
 	// Xiaochuan Liu
 	// fix openpdf bug(mantis id:0055683, google id:360198)
 	// the function CurveSetElemTypeFree in cmslut.c also needs to check pointer
-    if (In == NULL || In ->InterpParams == NULL) return NULL;
+    if (In == NULL || In ->InterpParams == NULL || In ->Segments == NULL || In ->Table16 == NULL) return NULL;
 
     return  AllocateToneCurveStruct(In ->InterpParams ->ContextID, In ->nEntries, In ->nSegments, In ->Segments, In ->Table16);
 }