mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 22:11:04 +01:00
Sweep-gradient color-stop angles come from the font, so the interpolation fraction t can fall outside [0,1] (or be NaN). The interpolated channel was then cast float -> unsigned directly; a negative value (e.g. -387.671) is UB (UBSan float-cast-overflow) and yields meaningless colors on release builds. Clamp the interpolated channel to [0,255], mapping NaN to 0, before the cast. In-range behavior is unchanged. Add the reported fuzzer input as a seed. Reported by iceray-Li. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>