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 Review URL: https://codereview.webrtc.org/1176303004. Cr-Commit-Position: refs/heads/master@{#9436}
Name: WebRTC URL: http://www.webrtc.org Version: 90 License: BSD License File: LICENSE Description: WebRTC provides real time voice and video processing functionality to enable the implementation of PeerConnection/MediaStream. Third party code used in this project is described in the file LICENSE_THIRD_PARTY.