commit | 58c1e6d0ff1f2975e55afc524296ba1f1ab73dbc | [log] [tgz] |
---|---|---|
author | Phil Burk <philburk@google.com> | Mon Jan 17 17:28:28 2022 +0000 |
committer | Phil Burk <philburk@google.com> | Mon Jan 24 16:33:34 2022 +0000 |
tree | 20a1ac8df6e9b5017e8605df714a873b0d6f9fda | |
parent | b4f42a9b0d823c6460285b8d7a80fd429c4a6564 [diff] [blame] |
aaudio: protect MonotonicCounter from overflow Use __builtin_sub_overflow. Bug: 214726263 Test: atest test_monotonic_counter Test: Run OboeTester with Legacy output for 13 hours. Change-Id: Ie3cbf155c3059f50c17a32361c203265d63dc31b
diff --git a/media/libaaudio/src/legacy/AudioStreamTrack.cpp b/media/libaaudio/src/legacy/AudioStreamTrack.cpp index 17a6d0c..6f1dc92 100644 --- a/media/libaaudio/src/legacy/AudioStreamTrack.cpp +++ b/media/libaaudio/src/legacy/AudioStreamTrack.cpp
@@ -508,7 +508,7 @@ case AAUDIO_STREAM_STATE_PAUSED: result = mAudioTrack->getPosition(&position); if (result == OK) { - mFramesRead.update32(position); + mFramesRead.update32((int32_t)position); } break; default: