Changeset 217005 in webkit
- Timestamp:
- May 17, 2017 2:53:01 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r217004 r217005 1 2017-05-17 Per Arne Vollan <pvollan@apple.com> 2 3 Crash under WebCore::AudioSourceProviderAVFObjC::process(). 4 https://bugs.webkit.org/show_bug.cgi?id=172101 5 rdar://problem/27446589 6 7 Reviewed by Jer Noble. 8 9 Calling the function MTAudioProcessingTapGetSourceAudio when the value of the 10 MTAudioProcessingTapRef parameter is null, will lead to a null dereference. 11 This can for example happen if MediaPlayerPrivateAVFoundationObjC::cancelLoad() 12 is called on the main thread while MediaToolbox is calling the 13 WebCore::AudioSourceProviderAVFObjC::processCallback function on a secondary 14 thread. MediaPlayerPrivateAVFoundationObjC::cancelLoad() will then call 15 AudioSourceProviderAVFObjC::setPlayerItem(nullptr), which will call 16 AudioSourceProviderAVFObjC::destroyMix(), which will set m_tap to null. When 17 AudioSourceProviderAVFObjC::process is called on the secondary thread, using 18 the m_tap member in the call to MTAudioProcessingTapGetSourceAudio, the process 19 will crash. 20 21 No new tests since I am not able to reproduce. 22 23 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: 24 (WebCore::AudioSourceProviderAVFObjC::initCallback): 25 (WebCore::AudioSourceProviderAVFObjC::process): 26 1 27 2017-05-17 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm
r214227 r217005 238 238 void AudioSourceProviderAVFObjC::initCallback(MTAudioProcessingTapRef tap, void* clientInfo, void** tapStorageOut) 239 239 { 240 ASSERT(tap); 240 241 AudioSourceProviderAVFObjC* _this = static_cast<AudioSourceProviderAVFObjC*>(clientInfo); 241 242 _this->m_tap = tap; … … 360 361 { 361 362 UNUSED_PARAM(flags); 363 364 RetainPtr<MTAudioProcessingTapRef> tap = m_tap; 365 if (!tap) 366 return; 362 367 363 368 CMItemCount itemCount = 0; 364 369 CMTimeRange rangeOut; 365 OSStatus status = MTAudioProcessingTapGetSourceAudio( m_tap.get(), numberOfFrames, bufferListInOut, flagsOut, &rangeOut, &itemCount);370 OSStatus status = MTAudioProcessingTapGetSourceAudio(tap.get(), numberOfFrames, bufferListInOut, flagsOut, &rangeOut, &itemCount); 366 371 if (status != noErr || !itemCount) 367 372 return;
Note: See TracChangeset
for help on using the changeset viewer.