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

Commit 206b7b17 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 8974

* changes:
  Fix OOB in arraycopy.
parents 75ac5fb8 18a081e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -516,14 +516,14 @@ public final class MotionEvent implements Parcelable {
        }
        
        final int NS = (ev.mNumPointers=o.mNumPointers) * NT;
        if (ev.mStateSamples.length < NS) {
        if (ev.mStateSamples.length >= NS) {
            System.arraycopy(o.mStateSamples, 0, ev.mStateSamples, 0, NS);
        } else {
            ev.mStateSamples = (int[])o.mStateSamples.clone();
        }
        
        final int ND = NS * NUM_SAMPLE_DATA;
        if (ev.mDataSamples.length < ND) {
        if (ev.mDataSamples.length >= ND) {
            System.arraycopy(o.mDataSamples, 0, ev.mDataSamples, 0, ND);
        } else {
            ev.mDataSamples = (float[])o.mDataSamples.clone();