Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent null CO access when cloning sampler or preview #13740

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

acolombier
Copy link
Member

No description provided.

@github-actions github-actions bot added the engine label Oct 8, 2024
Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

LGTM, I guess, though I'll let someone else that reviewed this code be the judge.

(deckToClone->m_stemGain.empty() &&
deckToClone->m_stemMute.empty())) {
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

The verify blow includes this check and sticks around at release time. So this check can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does but it's not equivalent.

Having the two vector empty is an expected case, for which we do an early return. The assert condition adds extra usecase that would crash the for-loop but are not expected usecase on which we should assert.

I agree that this would technically add couple of extra instructions at release time, but since this function is not time critical, I would suggest we keep the clear distinction between the early return on excepted usecase, and protective return on unexpected case.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see. How about replacing the first loop by
If (isPrimaryDeck())?

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds much cleaner indeed. Updated.

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you. Please squash the fixup and I will merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants