[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47226] branches/soc-2011-tomato/source/ blender/compositor/operations/COM_MaskOperation.cpp: Fixed crash of mask node when mask is not set

Sergey Sharybin sergey.vfx at gmail.com
Wed May 30 16:30:29 CEST 2012


Revision: 47226
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47226
Author:   nazgul
Date:     2012-05-30 14:30:28 +0000 (Wed, 30 May 2012)
Log Message:
-----------
Fixed crash of mask node when mask is not set

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_MaskOperation.cpp

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_MaskOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_MaskOperation.cpp	2012-05-30 14:24:33 UTC (rev 47225)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_MaskOperation.cpp	2012-05-30 14:30:28 UTC (rev 47226)
@@ -65,6 +65,9 @@
 	if (this->rasterizedMask)
 		return this->rasterizedMask;
 
+	if (!this->mask)
+		return NULL;
+
 	BLI_mutex_lock(getMutex());
 	if (this->rasterizedMask == NULL) {
 		int width = this->getWidth();
@@ -101,13 +104,21 @@
 
 void MaskOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)
 {
-	float *buffer = (float*) data;
-	int index = (y * this->getWidth() + x);
+	if (!data) {
+		color[0] = 0;
+		color[1] = 0;
+		color[2] = 0;
+		color[3] = 1.0f;
+	}
+	else {
+		float *buffer = (float*) data;
+		int index = (y * this->getWidth() + x);
 
-	color[0] = buffer[index];
-	color[1] = buffer[index];
-	color[2] = buffer[index];
-	color[3] = 1.0f;
+		color[0] = buffer[index];
+		color[1] = buffer[index];
+		color[2] = buffer[index];
+		color[3] = 1.0f;
+	}
 }
 
 




More information about the Bf-blender-cvs mailing list