From b15e1861ac1d8e98af8f8d33cb4e59cf0e0d3419 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 25 Oct 2021 15:12:50 +0200 Subject: Fix T92460: crash when instancing on curves generated from string Issue is that the Instance on Points node currently expects that all instance references are used (see `remove_unused_references`). This should be fixed at some point, but for now make sure that the String to Curves node does not output unused references. --- source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc') diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc index 1cb6d43f685..ac946540221 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc @@ -271,8 +271,9 @@ static void geo_node_string_to_curves_exec(GeoNodeExecParams params) /* Convert UTF-8 encoded string to UTF-32. */ size_t len_bytes; size_t len_chars = BLI_strlen_utf8_ex(layout.text.c_str(), &len_bytes); - Array char_codes(len_chars + 1); - BLI_str_utf8_as_utf32(char_codes.data(), layout.text.c_str(), len_chars + 1); + Array char_codes_with_null(len_chars + 1); + BLI_str_utf8_as_utf32(char_codes_with_null.data(), layout.text.c_str(), len_chars + 1); + const Span char_codes = char_codes_with_null.as_span().drop_back(1); /* Create and add instances. */ GeometrySet geometry_set_out; -- cgit v1.2.3