frameworks/base
修訂 | ecee2ebaf6a019e257b5751337188cbb857c1630 (tree) |
---|---|
時間 | 2019-10-18 04:56:20 |
作者 | Seigo Nonaka <nona@goog...> |
Commiter | Huizi Yang |
RESTRICT AUTOMERGE
Revive runLimit check logic
The runLimit check logic was accidentally removed by
I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735
Bug: 142134328
Bug: 140632678
Test: Manually done with reported step
Test: StaticLayoutTest passes
Change-Id: Ib1d5efdcb9adcc18a6a43370dc016ea464f48148
(cherry picked from commit 7b05578d9c87eee4ce5af64d9aee94e709f809cd)
@@ -239,6 +239,9 @@ class TextLine { | ||
239 | 239 | for (int i = 0; i < runs.length; i += 2) { |
240 | 240 | int runStart = runs[i]; |
241 | 241 | int runLimit = runStart + (runs[i+1] & Layout.RUN_LENGTH_MASK); |
242 | + if (runLimit > mLen) { | |
243 | + runLimit = mLen; | |
244 | + } | |
242 | 245 | if (runStart > mLen) break; |
243 | 246 | boolean runIsRtl = (runs[i+1] & Layout.RUN_RTL_FLAG) != 0; |
244 | 247 |
@@ -314,6 +317,9 @@ class TextLine { | ||
314 | 317 | for (int i = 0; i < runs.length; i += 2) { |
315 | 318 | int runStart = runs[i]; |
316 | 319 | int runLimit = runStart + (runs[i+1] & Layout.RUN_LENGTH_MASK); |
320 | + if (runLimit > mLen) { | |
321 | + runLimit = mLen; | |
322 | + } | |
317 | 323 | if (runStart > mLen) break; |
318 | 324 | boolean runIsRtl = (runs[i+1] & Layout.RUN_RTL_FLAG) != 0; |
319 | 325 |
@@ -401,6 +407,9 @@ class TextLine { | ||
401 | 407 | for (int i = 0; i < runs.length; i += 2) { |
402 | 408 | int runStart = runs[i]; |
403 | 409 | int runLimit = runStart + (runs[i + 1] & Layout.RUN_LENGTH_MASK); |
410 | + if (runLimit > mLen) { | |
411 | + runLimit = mLen; | |
412 | + } | |
404 | 413 | if (runStart > mLen) break; |
405 | 414 | boolean runIsRtl = (runs[i + 1] & Layout.RUN_RTL_FLAG) != 0; |
406 | 415 |