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

Skip to content
Commit 349b8b4c authored by Chong Zhang's avatar Chong Zhang
Browse files

stagefright: fix potential codec leaks in async stop/reset

Currently if stop is followed by a reset from another thread,
we unblock the stop first (to avoid ANR) without waiting for
kWhatShutdownCompleted, and proceed with the reset request.
But this could cause release to return too early when the
kWhatShutdownCompleted for the stop is received. When this
happens, the reset() will unregister ACodec's handlers before
the real shutdown with deallocation is processed, causing
a codec node instance to be leaked.

To solve this problem, separate kWhatShutdownCompleted into
two messages kWhatStopCompleted and kWhatReleaseCompleted.
Release should only return upon kWhatReleaseCompleted.

Also initializing the fence fd in the metadata buffer (even
though it's not used) to avoid warning in freeBuffer.

bug: 32750454
bug: 32971559

Change-Id: If218c853955729a2a2f2e8356908115a79c442e3
parent 4d2bf460
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment