From 39ee9dfac1c6d286a4075c7e2435fe1cfe365bad Mon Sep 17 00:00:00 2001 From: kcwu Date: Thu, 22 Sep 2016 18:26:22 -0700 Subject: Fix memory leaks in lcms found by libfuzzer Review-Url: https://codereview.chromium.org/2359243003 --- .../lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 third_party/lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch (limited to 'third_party/lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch') diff --git a/third_party/lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch b/third_party/lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch new file mode 100644 index 0000000000..2c55b94fa1 --- /dev/null +++ b/third_party/lcms2-2.6/0007-memory-leak-OptimizeByResampling.patch @@ -0,0 +1,13 @@ +diff --git a/third_party/lcms2-2.6/src/cmsopt.c b/third_party/lcms2-2.6/src/cmsopt.c +index f885ef3..684910d 100644 +--- a/third_party/lcms2-2.6/src/cmsopt.c ++++ b/third_party/lcms2-2.6/src/cmsopt.c +@@ -612,7 +612,7 @@ cmsBool OptimizeByResampling(cmsPipeline** Lut, cmsUInt32Number Intent, cmsUInt3 + + // Allocate the CLUT + CLUT = cmsStageAllocCLut16bit(Src ->ContextID, nGridPoints, Src ->InputChannels, Src->OutputChannels, NULL); +- if (CLUT == NULL) return FALSE; ++ if (CLUT == NULL) goto Error; + + // Add the CLUT to the destination LUT + if (!cmsPipelineInsertStage(Dest, cmsAT_END, CLUT)) { -- cgit v1.2.3