From e69316ea6e87b76852589dc51a3aa384b295c0d6 Mon Sep 17 00:00:00 2001 From: xkernel Date: Sun, 5 Nov 2023 23:14:07 +0800 Subject: [PATCH] add NULL check for mpe in Type_LUT8_Write --- src/cmstypes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmstypes.c b/src/cmstypes.c index b0e8c7ec..42271b5f 100644 --- a/src/cmstypes.c +++ b/src/cmstypes.c @@ -1922,7 +1922,7 @@ cmsBool Type_LUT8_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, // Disassemble the LUT into components. mpe = NewLUT -> Elements; - if (mpe ->Type == cmsSigMatrixElemType) { + if (mpe != NULL && mpe ->Type == cmsSigMatrixElemType) { if (mpe->InputChannels != 3 || mpe->OutputChannels != 3) return FALSE; MatMPE = (_cmsStageMatrixData*) mpe ->Data;