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

Commit bbddde0c authored by Dorin Drimus's avatar Dorin Drimus
Browse files

Fix AudioFlinger crash after playing overnight.

Track position overflows max int and that lead to check crash.
Add logic to covert position to a reasonable value in AudioFlinger
to avoid this crash.

PD#SWPL-68459
Bug: 297141696

Test: manual
U + ohm

Change-Id: Ifa70d1c196599f779947c0e9762f119156329136
parent 1a442e92
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -451,6 +451,10 @@ Status TrackHandle::getTimestamp(media::AudioTimestampInternal* timestamp,
    if (*_aidl_return != OK) {
        return Status::ok();
    }

    // restrict position modulo INT_MAX to avoid integer sanitization abort
    legacy.mPosition &= INT_MAX;

    *timestamp = legacy2aidl_AudioTimestamp_AudioTimestampInternal(legacy).value();
    return Status::ok();
}