From 27630f41a7ac9bd0677d0df5a301a86785397a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Sun, 1 Jun 2014 16:30:58 +0200 Subject: Fix T40459: Gauss table can be NULL when ending the blur node operation, which must not be passed to MEM_freeN. --- .../operations/COM_GaussianAlphaXBlurOperation.cpp | 14 ++++++++++---- .../operations/COM_GaussianAlphaYBlurOperation.cpp | 14 ++++++++++---- .../operations/COM_GaussianBokehBlurOperation.cpp | 7 +++++-- .../compositor/operations/COM_GaussianXBlurOperation.cpp | 1 + .../compositor/operations/COM_GaussianYBlurOperation.cpp | 1 + 5 files changed, 27 insertions(+), 10 deletions(-) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp index 69aa7d0fee5..c78347e7b1c 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp @@ -146,10 +146,16 @@ void GaussianAlphaXBlurOperation::executePixel(float output[4], int x, int y, vo void GaussianAlphaXBlurOperation::deinitExecution() { BlurBaseOperation::deinitExecution(); - MEM_freeN(this->m_gausstab); - this->m_gausstab = NULL; - MEM_freeN(this->m_distbuf_inv); - this->m_distbuf_inv = NULL; + + if (this->m_gausstab) { + MEM_freeN(this->m_gausstab); + this->m_gausstab = NULL; + } + + if (this->m_distbuf_inv) { + MEM_freeN(this->m_distbuf_inv); + this->m_distbuf_inv = NULL; + } deinitMutex(); } diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp index ae1f309c54f..ab97c8b0d13 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp @@ -146,10 +146,16 @@ void GaussianAlphaYBlurOperation::executePixel(float output[4], int x, int y, vo void GaussianAlphaYBlurOperation::deinitExecution() { BlurBaseOperation::deinitExecution(); - MEM_freeN(this->m_gausstab); - this->m_gausstab = NULL; - MEM_freeN(this->m_distbuf_inv); - this->m_distbuf_inv = NULL; + + if (this->m_gausstab) { + MEM_freeN(this->m_gausstab); + this->m_gausstab = NULL; + } + + if (this->m_distbuf_inv) { + MEM_freeN(this->m_distbuf_inv); + this->m_distbuf_inv = NULL; + } deinitMutex(); } diff --git a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp index d5743c41c94..441b623b589 100644 --- a/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp @@ -157,8 +157,11 @@ void GaussianBokehBlurOperation::executePixel(float output[4], int x, int y, voi void GaussianBokehBlurOperation::deinitExecution() { BlurBaseOperation::deinitExecution(); - MEM_freeN(this->m_gausstab); - this->m_gausstab = NULL; + + if (this->m_gausstab) { + MEM_freeN(this->m_gausstab); + this->m_gausstab = NULL; + } deinitMutex(); } diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index 815b89ae8d9..d08924ca4ef 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -100,6 +100,7 @@ void GaussianXBlurOperation::executePixel(float output[4], int x, int y, void *d void GaussianXBlurOperation::deinitExecution() { BlurBaseOperation::deinitExecution(); + if (this->m_gausstab) { MEM_freeN(this->m_gausstab); this->m_gausstab = NULL; diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index 47c031757fb..8216b79372f 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -101,6 +101,7 @@ void GaussianYBlurOperation::executePixel(float output[4], int x, int y, void *d void GaussianYBlurOperation::deinitExecution() { BlurBaseOperation::deinitExecution(); + if (this->m_gausstab) { MEM_freeN(this->m_gausstab); this->m_gausstab = NULL; -- cgit v1.2.3