1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

SimpleShapedText: Fix potential heap buffer overflow

This commit is contained in:
reuk 2025-07-03 12:31:41 +01:00
parent 320a48ae82
commit 22d5d7a598
No known key found for this signature in database

View file

@ -615,10 +615,10 @@ static RangedValues<Font> resolveFontsWithFallback (Span<const juce_wchar> strin
for (const auto [r, f] : fonts)
{
const auto constrained = r.constrainRange ({ 0, (int64) string.size() });
const auto intersected = r.getIntersectionWith ({ 0, (int64) string.size() });
auto rf = findSuitableFontsForText (f,
{ string.data() + constrained.getStart(),
(size_t) constrained.getLength() });
{ string.data() + intersected.getStart(),
(size_t) intersected.getLength() });
for (const auto [subRange, font] : rf)
{