Bug 36142 - [Qt] MediaPlayerPrivate: don't crash when no media services can be found.
Summary: [Qt] MediaPlayerPrivate: don't crash when no media services can be found.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
Depends on:
Reported: 2010-03-15 14:59 PDT by Jakub Wieczorek
Modified: 2010-03-16 09:25 PDT (History)
0 users

See Also:

Patch (1.75 KB, patch)
2010-03-15 15:04 PDT, Jakub Wieczorek
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Wieczorek 2010-03-15 14:59:06 PDT
When no media services for QtMultimedia are installed, Qt outputs this to stderr:
defaultServiceProvider::requestService(): no service found for - "com.nokia.qt.mediaplayer",
and then in some situations QtWebKit would crash. In my case it was crashing in MediaPlayerPrivate::buffered(), with the following backtrace:

(gdb) frame 0
#0  0x00007ffff70db13b in WebCore::MediaPlayerPrivate::buffered (this=0xc16390) at ../../../WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp:303
303         QMediaTimeRange playbackRanges = m_mediaPlayerControl->availablePlaybackRanges();
#1  0x00007ffff70cc4ed in WebCore::MediaPlayer::buffered (this=0xebc520) at ../../../WebCore/platform/graphics/MediaPlayer.cpp:455
No locals.
#2  0x00007ffff6ff1510 in WebCore::RenderThemeQt::paintMediaSliderTrack (this=0x810510, o=0x13627f8, paintInfo=..., r=...) at ../../../WebCore/platform/qt/RenderThemeQt.cpp:1118
        buffered = {m_ptr = 0x7fffffffb2c0}
        player = 0xebc520
        mediaElement = <value optimized out>
        p = {painter = 0x7fffffffc490, widget = 0x88dbb0, style = 0x7d6060, oldBrush = {d = {d = 0xd25d50}}, oldAntialiasing = true}

m_mediaPlayerControl is not null there, even though it should:

(gdb) print m_mediaPlayerControl
$1 = (class QMediaPlayerControl *) 0x1a400000088
Comment 1 Jakub Wieczorek 2010-03-15 15:04:48 PDT
Created attachment 50745 [details]
Comment 2 Eric Seidel (no email) 2010-03-15 19:02:46 PDT
Comment on attachment 50745 [details]

Test case?
Comment 3 Jakub Wieczorek 2010-03-16 07:58:02 PDT
(In reply to comment #2)
> (From update of attachment 50745 [details])
> Test case?

The presence of the bug depends on the installed media backends so I am afraid this cannot be easily testable or at least the test would be much more complicated than the fix itself.
Comment 4 Jakub Wieczorek 2010-03-16 09:25:24 PDT
Committed r56065: http://trac.webkit.org/changeset/56065