[Bf-blender-cvs] [9ca3d4cbbde] blender-v2.79-release: Cycles Bake: Fix overflow when using hundreds of images

Dalai Felinto noreply at git.blender.org
Mon Sep 4 15:51:57 CEST 2017


Commit: 9ca3d4cbbde88edc6ce6c761dd9f8a7036a04840
Author: Dalai Felinto
Date:   Thu Aug 24 10:34:50 2017 +0200
Branches: blender-v2.79-release
https://developer.blender.org/rB9ca3d4cbbde88edc6ce6c761dd9f8a7036a04840

Cycles Bake: Fix overflow when using hundreds of images

We have a hardcored limit of 1000 images to be baked.
However anything anove 100 would be leading to overflow in the code.

Caught by warning from builder bot (my compiler doesn't even complain
about this, but it should).

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

M	source/blender/editors/object/object_bake_api.c

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

diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index ad43c48f0b9..f8ad5865887 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -1029,7 +1029,7 @@ cage_cleanup:
 						}
 						else {
 							/* if everything else fails, use the material index */
-							char tmp[4];
+							char tmp[5];
 							sprintf(tmp, "%d", i % 1000);
 							BLI_path_suffix(name, FILE_MAX, tmp, "_");
 						}



More information about the Bf-blender-cvs mailing list