Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 821e9bd5 authored by Seigo Nonaka's avatar Seigo Nonaka Committed by android-build-team Robot
Browse files

Fix crash during cursor moving on BiDi text

The crash was introduced by Ib66ef392c19c937718e7101f6d48fac3abe51ad0
The root cause of the crashing is requesting out-of-line access for the
horizontal width. This invalid access is silently ignored by
TextLine#measure() method but new implementation end up with out of
bounds access.

To makes behavior as old implementation, calling getHorizontal instead
of accessing measured result array.

Bug: 78464361, 111580019
Test: Manually done
Change-Id: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit 960647d5)
Merged-In: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit a1076fda)
parent f45705cb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1583,7 +1583,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];