DescriptionFix a data race in AudioEncoderMutableImpl and derived classes
Before this change, it could happen that a caller would get a pointer
to the encoder_ but not use it before another thread called the
Reconstruct method, changing the pointer. This of course resulted in
bad access crashes. With this change, each use of the pointer acquired
from the encoder() method is protected by the same lock that is
required to update the pointer. Note that this fix is probably too
aggressive, since it also affects the Opus implementation; the crash
has so far only been seen for iSAC.
Also adding a test to trigger the problem. The test did not trigger
the problem deterministically, but out would typically find it in less
than 1000 runs.
BUG=chromium:499468
R=jmarusic@webrtc.org, kwiberg@webrtc.org
Committed: https://chromium.googlesource.com/external/webrtc/+/a6aa6d96f8aa10736c76deb2a6ef09027d375a4a
Patch Set 1 #
Total comments: 6
Patch Set 2 : Fix for test racyness #Patch Set 3 : Including config_ in the critical section #Patch Set 4 : Return config_ by value instead of reference #
Messages
Total messages: 13 (1 generated)
|