summaryrefslogtreecommitdiff
path: root/third_party/lcms2-2.6
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/lcms2-2.6')
-rw-r--r--third_party/lcms2-2.6/0010-reject-nan.patch13
-rw-r--r--third_party/lcms2-2.6/README.pdfium1
-rw-r--r--third_party/lcms2-2.6/src/cmsplugin.c2
3 files changed, 16 insertions, 0 deletions
diff --git a/third_party/lcms2-2.6/0010-reject-nan.patch b/third_party/lcms2-2.6/0010-reject-nan.patch
new file mode 100644
index 0000000000..2cf49ca0f7
--- /dev/null
+++ b/third_party/lcms2-2.6/0010-reject-nan.patch
@@ -0,0 +1,13 @@
+diff --git a/third_party/lcms2-2.6/src/cmsplugin.c b/third_party/lcms2-2.6/src/cmsplugin.c
+index 8903d2b..b95befb 100644
+--- a/third_party/lcms2-2.6/src/cmsplugin.c
++++ b/third_party/lcms2-2.6/src/cmsplugin.c
+@@ -179,6 +179,8 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n)
+
+ tmp = _cmsAdjustEndianess32(tmp);
+ *n = *(cmsFloat32Number*) &tmp;
++ if (isnan(*n))
++ return FALSE;
+ }
+ return TRUE;
+ }
diff --git a/third_party/lcms2-2.6/README.pdfium b/third_party/lcms2-2.6/README.pdfium
index 1fa3f56164..5a9497dbf8 100644
--- a/third_party/lcms2-2.6/README.pdfium
+++ b/third_party/lcms2-2.6/README.pdfium
@@ -19,4 +19,5 @@ Local Modifications:
0007-memory-leak-OptimizeByResampling.patch: Fix memory leak in OptimizeByResampling.
0008-memory-leak-Type_MPEmatrix_Read.patch: Fix memory leak in MPEmatrix_Read.
0009-cols-rows-swap.patch: Fix rows/cols swap in cmsStageAllocMatrix.
+0010-reject-nan.patch: Reject NaN when reading float numbers.
TODO(ochang): List other patches.
diff --git a/third_party/lcms2-2.6/src/cmsplugin.c b/third_party/lcms2-2.6/src/cmsplugin.c
index 8903d2bd61..b95befbd96 100644
--- a/third_party/lcms2-2.6/src/cmsplugin.c
+++ b/third_party/lcms2-2.6/src/cmsplugin.c
@@ -179,6 +179,8 @@ cmsBool CMSEXPORT _cmsReadFloat32Number(cmsIOHANDLER* io, cmsFloat32Number* n)
tmp = _cmsAdjustEndianess32(tmp);
*n = *(cmsFloat32Number*) &tmp;
+ if (isnan(*n))
+ return FALSE;
}
return TRUE;
}