Title: [212815] trunk/Source/WebCore
Revision
212815
Author
[email protected]
Date
2017-02-22 00:31:53 -0800 (Wed, 22 Feb 2017)

Log Message

[GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
https://bugs.webkit.org/show_bug.cgi?id=168662

Reviewed by Michael Catanzaro.

When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
doesn't implement buffered and always returns an empty PlatformTimeRanges.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (212814 => 212815)


--- trunk/Source/WebCore/ChangeLog	2017-02-22 08:30:18 UTC (rev 212814)
+++ trunk/Source/WebCore/ChangeLog	2017-02-22 08:31:53 UTC (rev 212815)
@@ -1,3 +1,19 @@
+2017-02-22  Carlos Garcia Campos  <[email protected]>
+
+        [GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=168662
+
+        Reviewed by Michael Catanzaro.
+
+        When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
+        there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
+        stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
+        nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
+        doesn't implement buffered and always returns an empty PlatformTimeRanges.
+
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.
+
 2017-02-21  Youenn Fablet  <[email protected]>
 
         [WebRTC][Mac] Activate libwebrtc

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp (212814 => 212815)


--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-02-22 08:30:18 UTC (rev 212814)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp	2017-02-22 08:31:53 UTC (rev 212815)
@@ -474,7 +474,7 @@
 
 std::unique_ptr<PlatformTimeRanges> MediaPlayerPrivateGStreamerMSE::buffered() const
 {
-    return m_mediaSource->buffered();
+    return m_mediaSource ? m_mediaSource->buffered() : std::make_unique<PlatformTimeRanges>();
 }
 
 void MediaPlayerPrivateGStreamerMSE::sourceChanged()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to