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

Commit 8381914f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix use after free in InputClassifier"

parents d71fd189 f2320aba
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -705,13 +705,12 @@ void InputClassifier::notifyKey(const NotifyKeyArgs* args) {
}

void InputClassifier::notifyMotion(const NotifyMotionArgs* args) {
    NotifyMotionArgs copyArgs = NotifyMotionArgs(*args);
    if (mMotionClassifier && isTouchEvent(*args)) {
        // We only cover touch events, for now.
        NotifyMotionArgs newArgs = NotifyMotionArgs(*args);
        newArgs.classification = mMotionClassifier->classify(newArgs);
        args = &newArgs;
        copyArgs.classification = mMotionClassifier->classify(copyArgs);
    }
    mListener->notifyMotion(args);
    mListener->notifyMotion(&copyArgs);
}

void InputClassifier::notifySwitch(const NotifySwitchArgs* args) {