Fix T40459: Gauss table can be NULL when ending the blur node operation,
authorLukas Tönne <lukas.toenne@gmail.com>
Sun, 1 Jun 2014 14:30:58 +0000 (16:30 +0200)
committerLukas Tönne <lukas.toenne@gmail.com>
Sun, 1 Jun 2014 14:35:26 +0000 (16:35 +0200)
which must not be passed to MEM_freeN.

source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp

index 69aa7d0fee529fd1c55b2e295aa89fe955dff250..c78347e7b1cfc9dd99af8dcc9db3354cf90ad847 100644 (file)
@@ -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();
 }
index ae1f309c54fc7081e50d8a645ae0f61e737dc64c..ab97c8b0d13b8f1ad87e7970e0f2f2edccde36f7 100644 (file)
@@ -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();
 }
index d5743c41c94281769bcae3cd575cdaa769cbe0e6..441b623b5899f39907ac4fc7665c1ffd5d9daf68 100644 (file)
@@ -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();
 }
index 815b89ae8d9037278c7616f123d6d83d44c549d3..d08924ca4efa24bbc088ac8ec3b480044d243eb6 100644 (file)
@@ -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;
index 47c031757fbaf6c843ab45047fac209b3e4b3dc2..8216b79372fe9a4cc44209473dc6f60f68ff2410 100644 (file)
@@ -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;