Skip to content

Conversation

@copybara-service
Copy link

Avoid calculating NaN for brush tip state parameters

Base brush attributes and individual brush behavior modifier values are guaranteed to be finite. However, two finite values multiplied together can overflow to infinity, and later multiplying that infinity by zero results in NaN, which is an invalid value for e.g. a brush tip width or height. This is causing occasional fuzz test failures.

If the multiplications had happened in a different order, we would first multiply zero by a finite value to get zero, then multiply that by the other finite value to get zero. In this particular context, infinities can only arise due to overflow, so it seems reasonable in this context to define zero times infinity as zero. Therefore, this change fixes the issue by checking for zeros before multiplying behavior modifiers together.

@copybara-service copybara-service bot force-pushed the test_838783618 branch 2 times, most recently from 4251706 to f52261d Compare December 1, 2025 18:58
@copybara-service copybara-service bot closed this Dec 1, 2025
@copybara-service copybara-service bot deleted the test_838783618 branch December 1, 2025 19:41
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.

0 participants