Skip to content

Fix crash reading RenderSettings with empty arnold:filter on a RenderVar (#2677)#2678

Open
cpichard wants to merge 1 commit into
Autodesk:masterfrom
cpichard:issue_2677
Open

Fix crash reading RenderSettings with empty arnold:filter on a RenderVar (#2677)#2678
cpichard wants to merge 1 commit into
Autodesk:masterfrom
cpichard:issue_2677

Conversation

@cpichard
Copy link
Copy Markdown
Collaborator

@cpichard cpichard commented Jun 3, 2026

Summary

Fixes a crash (segfault) when reading a UsdRenderSettings scene where a RenderVar has an empty arnold:filter attribute (custom string arnold:filter = "").

The empty string overrode the box_filter default with an empty filter type, so CreateArnoldNode("") returned nullptr and the node was then dereferenced via AiNodeGetNodeEntry(filter) in libs/common/rendersettings_utils.cpp, crashing Arnold. This is shared code, so it affected both the usd procedural (kick) and the render delegate / husk paths.

Fixes #2677.

Changes

  • libs/common/rendersettings_utils.cpp:
    • Only override the default filter type when a non-empty arnold:filter value is authored.
    • Skip the RenderVar if the filter node could not be created (unknown/invalid filter type), instead of dereferencing a null node.
  • testsuite/test_2677/: reproduces the crash (scene reduced from a customer file).

Test

testsuite/test_2677 renders the repro scene via kick; it crashed before the fix and renders after it.

🤖 Generated with Claude Code

…Var (Autodesk#2677)

An empty "arnold:filter" attribute on a RenderVar overrode the box_filter
default with an empty filter type, so CreateArnoldNode("") returned null and
the node was dereferenced via AiNodeGetNodeEntry, crashing Arnold.

Only override the default filter type when a non-empty value is authored, and
skip the RenderVar if the filter node could not be created (unknown/invalid
type). Adds testsuite/test_2677 reproducing the crash.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a crash in the shared RenderSettings translation path when a UsdRenderVar authors an empty arnold:filter (or otherwise results in a filter node that cannot be created), preventing null dereferences during AOV filter setup. This impacts both the usd procedural (kick) and render delegate / husk paths.

Changes:

  • Treat an authored empty arnold:filter as “not overriding” the default filter type (box_filter).
  • Guard against invalid/unknown filter types by skipping the RenderVar if filter creation still returns nullptr.
  • Add regression coverage via a new testsuite repro scene for issue #2677.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
libs/common/rendersettings_utils.cpp Adds defensive handling for empty/invalid arnold:filter values to avoid null dereference crashes when configuring AOV filters.
testsuite/test_2677/README Documents the crash repro and test parameters for running the new regression test.
testsuite/test_2677/data/test.usda Provides a minimal USD scene that previously triggered the segfault (empty arnold:filter).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


See #2677

author: cyril.pichard@autodesk.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash rendering UsdRenderSettings scene with empty arnold:filter on a RenderVar

2 participants