Fix: invalid memory access in Hydra world and material export

This commit is contained in:
Brecht Van Lommel
2024-01-10 20:43:36 +01:00
parent 4e0d604035
commit eb747c5d20
2 changed files with 2 additions and 2 deletions

View File

@@ -72,10 +72,10 @@ void WorldData::init()
if (!input_socket) {
return;
}
bNodeLink const *link = input_socket->directly_linked_links()[0];
if (input_socket->directly_linked_links().is_empty()) {
return;
}
bNodeLink const *link = input_socket->directly_linked_links()[0];
bNode *input_node = link->fromnode;
if (input_node->type != SH_NODE_BACKGROUND) {

View File

@@ -60,7 +60,7 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph,
if (material->use_nodes) {
material->nodetree->ensure_topology_cache();
bNode *output_node = ntreeShaderOutputNode(material->nodetree, SHD_OUTPUT_ALL);
if (output_node) {
if (output_node && output_node->typeinfo->materialx_fn) {
NodeParserData data = {doc.get(),
depsgraph,
material,