Title: [247778] trunk
- Revision
- 247778
- Author
- [email protected]
- Date
- 2019-07-24 10:34:22 -0700 (Wed, 24 Jul 2019)
Log Message
[GStreamer] Don't crash with empty video src
https://bugs.webkit.org/show_bug.cgi?id=200081
LayoutTests/imported/w3c:
Reviewed by Philippe Normand.
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html: Added.
Source/WebCore:
When a <video> element is set to load empty or about:blank, a player is still
created, but no pipeline is loaded. This patch fixes some assertion errors that
manifested in that case.
Reviewed by Philippe Normand.
Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (247777 => 247778)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2019-07-24 17:16:53 UTC (rev 247777)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2019-07-24 17:34:22 UTC (rev 247778)
@@ -1,3 +1,12 @@
+2019-07-24 Alicia Boya García <[email protected]>
+
+ [GStreamer] Don't crash with empty video src
+ https://bugs.webkit.org/show_bug.cgi?id=200081
+
+ Reviewed by Philippe Normand.
+
+ * web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html: Added.
+
2019-07-17 Alex Christensen <[email protected]>
Add a runtime-disabled dialog element skeleton
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html (0 => 247778)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html 2019-07-24 17:34:22 UTC (rev 247778)
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>HTML5 Media Elements: An empty src should not crash the player.</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+ <link rel="author" title="Alicia Boya García" href=""
+ <script src=""
+ <script src=""
+</head>
+<body>
+<script>
+ function makeCrashTest(src) {
+ async_test(function (test) {
+ const video = document.createElement("video");
+ video.src = ""
+ video.controls = true;
+ document.body.appendChild(video);
+ test.step_timeout(test.step_func(() => {
+ document.body.removeChild(video);
+ test.done();
+ }), 0);
+ }, `src="" does not crash.`);
+ }
+
+ makeCrashTest("about:blank");
+ makeCrashTest("");
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (247777 => 247778)
--- trunk/Source/WebCore/ChangeLog 2019-07-24 17:16:53 UTC (rev 247777)
+++ trunk/Source/WebCore/ChangeLog 2019-07-24 17:34:22 UTC (rev 247778)
@@ -1,3 +1,21 @@
+2019-07-24 Alicia Boya García <[email protected]>
+
+ [GStreamer] Don't crash with empty video src
+ https://bugs.webkit.org/show_bug.cgi?id=200081
+
+ When a <video> element is set to load empty or about:blank, a player is still
+ created, but no pipeline is loaded. This patch fixes some assertion errors that
+ manifested in that case.
+
+ Reviewed by Philippe Normand.
+
+ Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_crash_empty_src.html
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::loadFull):
+ (WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
+ (WebCore::MediaPlayerPrivateGStreamer::paused const):
+
2019-07-23 Justin Fan <[email protected]>
[WebGPU] Implement errors for GPURenderPipeline creation
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (247777 => 247778)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2019-07-24 17:16:53 UTC (rev 247777)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2019-07-24 17:34:22 UTC (rev 247778)
@@ -280,8 +280,10 @@
}
URL url(URL(), urlString);
- if (url.protocolIsAbout())
+ if (url.protocolIsAbout()) {
+ loadingFailed(MediaPlayer::FormatError, MediaPlayer::HaveNothing, true);
return;
+ }
if (!m_pipeline)
createGSTPlayBin(url, pipelineName);
@@ -480,6 +482,9 @@
MediaTime MediaPlayerPrivateGStreamer::platformDuration() const
{
+ if (!m_pipeline)
+ return MediaTime::invalidTime();
+
GST_TRACE_OBJECT(pipeline(), "errorOccured: %s, pipeline state: %s", boolForPrinting(m_errorOccured), gst_element_state_get_name(GST_STATE(m_pipeline.get())));
if (m_errorOccured)
return MediaTime::invalidTime();
@@ -643,6 +648,9 @@
bool MediaPlayerPrivateGStreamer::paused() const
{
+ if (!m_pipeline)
+ return true;
+
if (m_isEndReached) {
GST_DEBUG_OBJECT(pipeline(), "Ignoring pause at EOS");
return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes