[Bf-blender-cvs] [5d51de3] master: Fix T39539

Jeroen Bakker noreply at git.blender.org
Mon Apr 28 22:07:09 CEST 2014


Commit: 5d51de3bea3ae500446587ebfc53c297afdbed82
Author: Jeroen Bakker
Date:   Mon Apr 28 22:00:44 2014 +0200
https://developer.blender.org/rB5d51de3bea3ae500446587ebfc53c297afdbed82

Fix T39539

Initialization of not initialized memory when accessing the renderlayer
directly

===================================================================

M	source/blender/compositor/operations/COM_RenderLayersProg.cpp

===================================================================

diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
index e7cda20..af0d1b0 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp
@@ -81,8 +81,16 @@ void RenderLayersBaseProg::doInterpolation(float output[4], float x, float y, Pi
 		case COM_PS_NEAREST: {
 			int ix = x;
 			int iy = y;
-			if (ix < 0 || iy < 0 || ix >= width || iy >= height)
+			if (ix < 0 || iy < 0 || ix >= width || iy >= height) {
+				if (this->m_elementsize == 1)
+					output[0] = 0.0f;
+				else if (this->m_elementsize == 3)
+					zero_v3(output);
+				else
+					zero_v4(output);
 				break;
+				
+			}
 
 			offset = (iy * width + ix) * this->m_elementsize;




More information about the Bf-blender-cvs mailing list