Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-02-14 19:05:29 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-02-14 19:08:11 +0300
commit7d85da882b177e4be251a44f356d62ed5f7c2de0 (patch)
treecdfc7abdee36e78623ff713e64996042776fac1f /intern
parentb4e10aa70b917eaeaeaa59a6ed16a4f824e4e2f3 (diff)
Cycles: Fix infinite recursion of md5 calculation on Windows
Was caused by some safety things of making sure we've for NULL terminator for the buffer when doing mbs<->wcs conversion, but it turns out this simply confuses str::string and it can no longer have proper .size(). Let's assume behavior of string allocation is same all over the std, and we can avoid having that extra null-terminator allocated.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/util/util_string.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/util/util_string.cpp b/intern/cycles/util/util_string.cpp
index d2c1ebe4151..51306a249cd 100644
--- a/intern/cycles/util/util_string.cpp
+++ b/intern/cycles/util/util_string.cpp
@@ -171,7 +171,7 @@ wstring string_to_wstring(const string& str)
str.length(),
NULL,
0);
- wstring str_wc(length_wc + 1, 0);
+ wstring str_wc(length_wc, 0);
MultiByteToWideChar(CP_ACP,
0,
str.c_str(),
@@ -190,7 +190,7 @@ string string_from_wstring(const wstring& str)
NULL,
0,
NULL, NULL);
- string str_mb(length_mb + 1, 0);
+ string str_mb(length_mb, 0);
WideCharToMultiByte(CP_ACP,
0,
str.c_str(),