From 1fb263700672f7a26d4e99a75aedbf258be5d173 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 24 Aug 2017 10:34:50 +0200 Subject: 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). --- source/blender/editors/object/object_bake_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '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, "_"); } -- cgit v1.2.3