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

Skip to content
Commit 2531d69c authored by Chong Zhang's avatar Chong Zhang
Browse files

muxer: set observer before we start waiting for read

If nobody ever reads the buffer before stop is called,
MediaAdapter will go ahead and release mCurrentMediaBuffer.
If it doesn't have an observer set, it will crash as it
does have a refcount of 1.

This can happen when the writer thread encountered an
error and calls stop early, in this case it will never
read the pending buffer.

bug: 70348810

Test:

- CTS MediaRecorderTest, MediaMuxerTest
- Hacked framework to produce a similar crash as in
  b/70348810 and verified no crash in stagefright.

Change-Id: Ia2017e6a13fca279c9603afe53ab6013b9c669f5
parent 0ebfd1e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment