DescriptionMerge "Avoid FFmpeg destroying active resources during demuxer stop."
The root cause is a combination of BufferedDataSource::Stop()
requiring a lock and BlockingURLProtocol::Read() returning
control to FFmpeg which may destory resources in use by an
ongoing BufferedDataSource::ReadCallback() call.
The lock in BDS::Stop() shared by BDS::ReadCallback() prevents
the stop signal from taking affect until after the read finishes,
however calling BUP::Abort() will immediately returns control to
FFmpeg which may destroy the resources in use by BDS::ReadCallback().
Sadly, given the racy nature and multi-class dependencies I've been
unable to craft a unit test for this, but I've manually verified this
fix works by arbitrarily delaying BDS::Stop() under an ASAN build.
BUG=411318
TEST=none
TBR=dalecurtis,scherkus
Review URL: https://codereview.chromium.org/544843005
Cr-Commit-Position: refs/heads/master@{#293995}
(cherry picked from commit 1973f0b6f7497b1887397de9bb36dbff4faf5e39)
Committed: https://chromium.googlesource.com/chromium/src/+/fa897c995fa7c7a209c389f4521d8a875c056c5a
Patch Set 1 #
Messages
Total messages: 3 (1 generated)
|