Fix potential UAF in usage of WeakPtrFactory
On destruction of AssistantAudioDecoder, the first member to be destroyed is the WeakPtrFactory, which happens before the media thread. However, if the media thread is currently running a task, that task's could call WeakPtrFactory::GetWeakPtr() on an already destroyed WeakPtrFactory. In general, WeakPtrs should only be bound/dereferenced on the same thread, although an existing WeakPtr can be copied on any thread. Bug: None Change-Id: I182292e8a51bf1e91934fbce237245bcf58be177 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542932 Commit-Queue: Anand K Mistry <amistry@chromium.org> Reviewed-by:Xiaohui Chen <xiaohuic@chromium.org> Reviewed-by:
Jeroen Dhollander <jeroendh@chromium.org> Cr-Commit-Position: refs/heads/master@{#828568}
Showing
Please register or sign in to comment