• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

修訂ecee2ebaf6a019e257b5751337188cbb857c1630 (tree)
時間2019-10-18 04:56:20
作者Seigo Nonaka <nona@goog...>
CommiterHuizi Yang

Log Message

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)

Change Summary

差異

--- a/core/java/android/text/TextLine.java
+++ b/core/java/android/text/TextLine.java
@@ -239,6 +239,9 @@ class TextLine {
239239 for (int i = 0; i < runs.length; i += 2) {
240240 int runStart = runs[i];
241241 int runLimit = runStart + (runs[i+1] & Layout.RUN_LENGTH_MASK);
242+ if (runLimit > mLen) {
243+ runLimit = mLen;
244+ }
242245 if (runStart > mLen) break;
243246 boolean runIsRtl = (runs[i+1] & Layout.RUN_RTL_FLAG) != 0;
244247
@@ -314,6 +317,9 @@ class TextLine {
314317 for (int i = 0; i < runs.length; i += 2) {
315318 int runStart = runs[i];
316319 int runLimit = runStart + (runs[i+1] & Layout.RUN_LENGTH_MASK);
320+ if (runLimit > mLen) {
321+ runLimit = mLen;
322+ }
317323 if (runStart > mLen) break;
318324 boolean runIsRtl = (runs[i+1] & Layout.RUN_RTL_FLAG) != 0;
319325
@@ -401,6 +407,9 @@ class TextLine {
401407 for (int i = 0; i < runs.length; i += 2) {
402408 int runStart = runs[i];
403409 int runLimit = runStart + (runs[i + 1] & Layout.RUN_LENGTH_MASK);
410+ if (runLimit > mLen) {
411+ runLimit = mLen;
412+ }
404413 if (runStart > mLen) break;
405414 boolean runIsRtl = (runs[i + 1] & Layout.RUN_RTL_FLAG) != 0;
406415