Changeset 220723 in webkit
- Timestamp:
- Aug 14, 2017 4:33:27 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220722 r220723 1 2017-08-14 Jer Noble <jer.noble@apple.com> 2 3 Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode 4 https://bugs.webkit.org/show_bug.cgi?id=175547 5 6 Reviewed by Eric Carlson. 7 8 When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored 9 proof-of-key-release data. 10 11 Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private 12 Browsing mode, to match the behavior of WebKitMediaKeySession. 13 14 * html/HTMLMediaElement.cpp: 15 (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const): 16 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: 17 (WebCore::CDMSessionAVStreamSession::releaseKeys): 18 (WebCore::CDMSessionAVStreamSession::update): 19 (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): 20 1 21 2017-08-14 Andy Estes <aestes@apple.com> 2 22 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r220472 r220723 2517 2517 String HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() const 2518 2518 { 2519 auto* page = document().page(); 2520 if (!page || page->usesEphemeralSession()) 2521 return emptyString(); 2522 2519 2523 String storageDirectory = document().settings().mediaKeysStorageDirectory(); 2520 2524 if (storageDirectory.isEmpty()) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm
r219767 r220723 143 143 return; 144 144 145 if (![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) 145 String storagePath = this->storagePath(); 146 if (storagePath.isEmpty() || ![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) 146 147 return; 147 148 148 149 RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]); 149 NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath ()]];150 NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 150 151 for (NSData* expiredSessionData in expiredSessions) { 151 152 NSDictionary *expiredSession = [NSPropertyListSerialization propertyListWithData:expiredSessionData options:kCFPropertyListImmutable format:nullptr error:nullptr]; … … 201 202 #pragma clang diagnostic push 202 203 #pragma clang diagnostic ignored "-Wobjc-literal-conversion" 203 if ([getAVStreamSessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)]) 204 [getAVStreamSessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath()]]; 204 String storagePath = this->storagePath(); 205 if (!storagePath.isEmpty() && [getAVStreamSessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)]) 206 [getAVStreamSessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 205 207 #pragma clang diagnostic pop 206 208 m_expiredSession = nullptr; … … 317 319 RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]); 318 320 319 if (![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) { 321 String storagePath = this->storagePath(); 322 if (storagePath.isEmpty() || ![getAVStreamSessionClass() respondsToSelector:@selector(pendingExpiredSessionReportsWithAppIdentifier:storageDirectoryAtURL:)]) { 320 323 errorCode = MediaPlayer::KeySystemNotSupported; 321 324 systemCode = '!mor'; … … 323 326 } 324 327 325 NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath ()]];328 NSArray* expiredSessions = [getAVStreamSessionClass() pendingExpiredSessionReportsWithAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]]; 326 329 if (![expiredSessions count]) { 327 330 LOG(Media, "CDMSessionAVStreamSession::generateKeyReleaseMessage(%p) - no expired sessions found", this);
Note: See TracChangeset
for help on using the changeset viewer.