Repository navigation
Fix issue #8: ColorType(int,int,int,int) sign-extends on high alpha - #36
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #36 +/- ##
============================================
+ Coverage 38.01% 38.06% +0.05%
Complexity 735 735
============================================
Files 243 244 +1
Lines 14863 14872 +9
Branches 2449 2449
============================================
+ Hits 5650 5661 +11
+ Misses 8011 8007 -4
- Partials 1202 1204 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Sep 5, 2026
Packed ARGB components via 32-bit int arithmetic and only then widened to the long-typed color_value field. With alpha >= 0x80 the packed int was negative, and Java's implicit int->long widening sign-extended it, so getColor() returned a value with the long's upper 32 bits all set to 1 instead of the plain unsigned 32-bit ARGB value the field's own Javadoc describes. Fixed by packing in long-typed arithmetic and masking to 32 bits. Adds CefSettingsTest as a regression test. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
Thrameos
force-pushed
the
backport/colortype-alpha-sign-extend
branch
from
September 5, 2026 21:23
b2c2c05 to
d4a4169
Compare
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.
Closes #8
Summary
CefSettings.ColorType's packing constructor computed the ARGB value entirely in 32-bitintarithmetic, then relied on implicit widening to store it into thelong color_valuefield.alpha >= 0x80, the intermediateintresult's sign bit was set, so Java's implicitint -> longwidening sign-extended it, leavingcolor_value's upper 32 bits all set to1instead of the plain unsigned 32-bit ARGB value the field's own Javadoc describes.long-typed arithmetic and masking to 32 bits.Test plan
CefSettingsTest(colorTypeHighAlphaDoesNotSignExtend,colorTypeLowAlpha) as a regression test — verified both pass post-fix.This is a small, focused backport of a single self-contained fix (no other changes bundled in), following the same shape as PR #1.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq