commit | af12f3c9f775ecaf37c562f9f9c28b702941ea73 | [log] [tgz] |
---|---|---|
author | Atneya Nair <atneya@google.com> | Mon Feb 28 15:44:25 2022 -0500 |
committer | Atneya Nair <atneya@google.com> | Mon Feb 28 19:14:04 2022 -0500 |
tree | e7bd2efb89c33287a93c10accaa4134ab1224064 | |
parent | b428b0099c094afb8b1e783066a20c4ff5700a5e [diff] |
Defer AudioTrack initialization to first ref Part of AudioTrack initialization involves sharing sp<> based refs to itself. If this initialization occurs during construction, races leading to pre-mature destruction and use after free errors are possible since sp<> creation requires a fully created object. Push this initialization (calling set) to onFirstRef. Test: atest AudioTrackTest Bug: 221393500 Change-Id: Ie28162ec4a975206cb81d13ec3afa930fbd1675c