Bug 146317

Summary: [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

Description Eric Carlson 2015-06-25 09:39:37 PDT
Missing a NULL check.
Comment 1 Eric Carlson 2015-06-25 09:39:57 PDT
<rdar://problem/21356176>
Comment 2 Eric Carlson 2015-06-25 09:42:21 PDT
Created attachment 255560 [details]
Proposed patch.
Comment 3 Brent Fulgham 2015-06-25 12:39:04 PDT
Comment on attachment 255560 [details]
Proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=255560&action=review

r=me

> Source/WebCore/html/HTMLMediaElement.cpp:6320
> +    if (m_player && m_hasPlaybackTargetAvailabilityListeners && !m_mediaSession->wirelessVideoPlaybackDisabled(*this) && m_player->canPlayToWirelessPlaybackTarget())

I wonder if m_mediaSession can ever be null?
Comment 4 Eric Carlson 2015-06-25 13:36:13 PDT
(In reply to comment #3)
> Comment on attachment 255560 [details]
> Proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=255560&action=review
> 
> r=me
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:6320
> > +    if (m_player && m_hasPlaybackTargetAvailabilityListeners && !m_mediaSession->wirelessVideoPlaybackDisabled(*this) && m_player->canPlayToWirelessPlaybackTarget())
> 
> I wonder if m_mediaSession can ever be null?

No, it is a std::unique_ptr<> that is allocated in the constructor.
Comment 5 Eric Carlson 2015-06-25 14:01:57 PDT
Committed r185962: https://trac.webkit.org/r185962