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

Skip to content
Commit 0f56965e authored by will-cw.chen's avatar will-cw.chen Committed by Wonsik Kim
Browse files

Fix MediaCodec potential use-after-free

Fix a MediaCodec potential use-after-free problem when
MediaCodec is started and onError occurs.

When onError -> SetState(UNINITAILIZED), there is a timing that
returnBuffersToCodec() is done and mState is not set to
UNINITAILIZED. At this moment, if getBuffer(..) is call, null
buffer will be gotten. Usually, APK will use is without checking,
and it cause the problem.

Test: manual with YouTube
Test: atest CtsMediaCodecTestCases -- --feature-flags:flag-value \
            codec_fwk/android.media.codec.set_state_early=true
Bug: 298613712
Flag: codec_fwk.android.media.codec.set_state_early
Change-Id: I4e9a4d3be7227e68ef2f59df4602d75fdc454001
parent 20c9bba5
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