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

Selecting custom color on non-100% DPI crashes settings #247

Merged
merged 6 commits into from
Jan 31, 2019

Conversation

llongley
Copy link
Member

Within the context of ColorSpectrum::CreateBitmapsAndColorMap(), minDimension is a non-integer value. We call round() on the value for pixelWidth and pixelHeight which we pass into CreateSurfaceFromPixelData(), but we just cast the value to an integer type without rounding when we call bgraMinPixelData->reserve(). As a result, the explicit pixel width and height that we use there can be out of sync with the implicit pixel width and height that we use to size the vectors into which we put color information. Since we round down when sizing the vector and up when filling the vector, we can run into a buffer overflow in this case.

@llongley llongley requested a review from a team as a code owner January 30, 2019 20:37
@llongley llongley merged commit 24b3dcb into master Jan 31, 2019
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.1.190131001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

StephenLPeters pushed a commit that referenced this pull request Feb 9, 2019
* Fixed an issue where we were rounding in one place and not in another.
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.1.190219001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

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.

3 participants