Fix crash reading RenderSettings with empty arnold:filter on a RenderVar (#2677)#2678
Open
cpichard wants to merge 1 commit into
Open
Fix crash reading RenderSettings with empty arnold:filter on a RenderVar (#2677)#2678cpichard wants to merge 1 commit into
cpichard wants to merge 1 commit into
Conversation
…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>
Contributor
There was a problem hiding this comment.
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:filteras “not overriding” the default filter type (box_filter). - Guard against invalid/unknown filter types by skipping the
RenderVarif filter creation still returnsnullptr. - 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a crash (segfault) when reading a
UsdRenderSettingsscene where aRenderVarhas an emptyarnold:filterattribute (custom string arnold:filter = "").The empty string overrode the
box_filterdefault with an empty filter type, soCreateArnoldNode("")returnednullptrand the node was then dereferenced viaAiNodeGetNodeEntry(filter)inlibs/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:arnold:filtervalue is authored.RenderVarif 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_2677renders the repro scene viakick; it crashed before the fix and renders after it.🤖 Generated with Claude Code