[automerger] Fix crash during cursor moving on BiDi text am: 82c84d5fbb am: 12baaa2bc3

Change-Id: Iaf0aded3004f33fdb52dd0c19779329991b24746
This commit is contained in:
Android Build Merger (Role)
2018-08-15 19:12:59 +00:00

View File

@@ -1390,7 +1390,8 @@ public abstract class Layout {
}
float get(final int offset) {
if (mHorizontals == null) {
if (mHorizontals == null || offset < mLineStartOffset
|| offset >= mLineStartOffset + mHorizontals.length) {
return getHorizontal(offset, mPrimary);
} else {
return mHorizontals[offset - mLineStartOffset];