Bug 146317 - [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
Summary: [Mac] Crash in WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-25 09:39 PDT by Eric Carlson
Modified: 2015-06-25 14:02 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch. (1.61 KB, patch)
2015-06-25 09:42 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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