WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
166407
NULL-deref CRASH in WebCore::PlatformMediaSession::mediaType
https://bugs.webkit.org/show_bug.cgi?id=166407
Summary
NULL-deref CRASH in WebCore::PlatformMediaSession::mediaType
Jer Noble
Reported
2016-12-21 18:13:45 PST
NULL-deref CRASH in WebCore::PlatformMediaSession::mediaType
Attachments
Patch
(8.74 KB, patch)
2016-12-21 18:18 PST
,
Jer Noble
darin
: review+
Details
Formatted Diff
Diff
Patch for landing
(9.26 KB, patch)
2016-12-22 10:57 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2016-12-21 18:18:11 PST
Created
attachment 297646
[details]
Patch
Darin Adler
Comment 2
2016-12-22 09:18:00 PST
Comment on
attachment 297646
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=297646&action=review
Looks great. Not sure when we use std::function, when we use WTF::Function, and when we use const& or && rather than passing by value. I’d like to clarify that in our style guide.
> Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:420 > +PlatformMediaSession* PlatformMediaSessionManager::findSession(std::function<bool(PlatformMediaSession&, size_t)> func) const
I would prefer the word "function" or "predicate" for the name of the argument, since we try to steer away from abbreviations in WebKit.
> Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:447 > +bool PlatformMediaSessionManager::anyOfSessions(std::function<bool(PlatformMediaSession&, size_t)> func) const > +{ > + return findSession(func); > }
Seems like this should be inlined in the header.
Jer Noble
Comment 3
2016-12-22 10:15:58 PST
(In reply to
comment #2
)
> Comment on
attachment 297646
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=297646&action=review
> > Looks great. > > Not sure when we use std::function, when we use WTF::Function, and when we > use const& or && rather than passing by value. I’d like to clarify that in > our style guide.
I didn't know WTF::Function was a thing!
> > Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:420 > > +PlatformMediaSession* PlatformMediaSessionManager::findSession(std::function<bool(PlatformMediaSession&, size_t)> func) const > > I would prefer the word "function" or "predicate" for the name of the > argument, since we try to steer away from abbreviations in WebKit.
Sure thing.
> > Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp:447 > > +bool PlatformMediaSessionManager::anyOfSessions(std::function<bool(PlatformMediaSession&, size_t)> func) const > > +{ > > + return findSession(func); > > } > > Seems like this should be inlined in the header.
Ok.
Jer Noble
Comment 4
2016-12-22 10:55:03 PST
(In reply to
comment #3
)
> (In reply to
comment #2
) > > Comment on
attachment 297646
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=297646&action=review
> > > > Looks great. > > > > Not sure when we use std::function, when we use WTF::Function, and when we > > use const& or && rather than passing by value. I’d like to clarify that in > > our style guide. > > I didn't know WTF::Function was a thing!
I went with WTF::Function and passing by const& (since ownership doesn't need to change).
Jer Noble
Comment 5
2016-12-22 10:57:51 PST
Created
attachment 297659
[details]
Patch for landing
WebKit Commit Bot
Comment 6
2016-12-22 12:08:01 PST
Comment on
attachment 297659
[details]
Patch for landing Clearing flags on attachment: 297659 Committed
r210104
: <
http://trac.webkit.org/changeset/210104
>
Jer Noble
Comment 7
2016-12-22 13:15:19 PST
<
rdar://problem/29139619
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug