1
0
Fork 0

Codefix: possible out-of-bounds array indexing

pull/13791/head
Rubidium 2025-03-09 23:02:50 +01:00 committed by rubidium42
parent cb3d3878fa
commit 0d902c9f5c
1 changed files with 3 additions and 3 deletions

View File

@ -443,11 +443,11 @@ std::unique_ptr<const ICUParagraphLayout::Line> ICUParagraphLayout::NextLine(int
size_t index; size_t index;
if ((overflow_run->level & 1) == 0) { if ((overflow_run->level & 1) == 0) {
/* LTR */ /* LTR */
for (index = overflow_run->glyphs.size(); index > 0; index--) { for (index = overflow_run->glyphs.size(); index > 0; /* nothing */) {
cur_width -= overflow_run->advance[index - 1]; --index;
cur_width -= overflow_run->advance[index];
if (cur_width <= max_width) break; if (cur_width <= max_width) break;
} }
index--;
} else { } else {
/* RTL */ /* RTL */
for (index = 0; index < overflow_run->glyphs.size(); index++) { for (index = 0; index < overflow_run->glyphs.size(); index++) {