Skip to content

Commit

Permalink
UsdUfe: Verify layers to prevent potential dereferencing of null hand…
Browse files Browse the repository at this point in the history
…le during save.

While UsdStage::GetUsedLayers() is not expected to return null layers,
an edge case was observed in production scenes using valueClips with
auto-generated manifest layers.
  • Loading branch information
jufrantz committed Nov 28, 2024
1 parent e8fc893 commit 1072bf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/usdUfe/utils/layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ StageDirtyState isStageDirty(const PXR_NS::UsdStage& stage)

SdfLayerHandleVector allLayers = stage.GetUsedLayers(true);
for (auto layer : allLayers) {
if (!layer->IsDirty())
if (!TF_VERIFY(layer) || !layer->IsDirty())
continue;

if (rootLayers.count(layer))
Expand Down

0 comments on commit 1072bf6

Please sign in to comment.