[Bf-blender-cvs] [ee2b583] master: Cycles-Bake: Fix Uninitialised value created by a heap allocation

Dalai Felinto noreply at git.blender.org
Mon Dec 21 18:30:39 CET 2015


Commit: ee2b583a059777162ce68eaa705481c210805513
Author: Dalai Felinto
Date:   Mon Dec 21 15:31:13 2015 -0200
Branches: master
https://developer.blender.org/rBee2b583a059777162ce68eaa705481c210805513

Cycles-Bake: Fix Uninitialised value created by a heap allocation

This was causing some random black bakes. It was introduced in of of the commits replacing calloc by malloc. Things should be better now.

This error was only noticeable when baking the selected objects (not when baking from selected to active).

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

M	source/blender/render/intern/source/bake_api.c

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

diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index d8166d1..9a26be8 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -645,6 +645,7 @@ void RE_bake_pixels_populate(
 	/* initialize all pixel arrays so we know which ones are 'blank' */
 	for (i = 0; i < num_pixels; i++) {
 		pixel_array[i].primitive_id = -1;
+		pixel_array[i].object_id = 0;
 	}
 
 	for (i = 0; i < bake_images->size; i++) {




More information about the Bf-blender-cvs mailing list