Title: [269062] releases/WebKitGTK/webkit-2.30
Revision
269062
Author
[email protected]
Date
2020-10-27 12:17:43 -0700 (Tue, 27 Oct 2020)

Log Message

Merge r269055 - [GStreamer] Bad handling of audio files in the ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=218239

Patch by Philippe Normand <[email protected]> on 2020-10-27
Reviewed by Adrian Perez de Castro.

Source/WebCore:

The final main thread notification needs to be blocking otherwise the decoder might get
disposed of too early.

Test: fast/images/animated-image-mp3-crash.html

* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::pushEncodedData):

LayoutTests:

* fast/images/animated-image-mp3-crash-expected.txt: Added.
* fast/images/animated-image-mp3-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog (269061 => 269062)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog	2020-10-27 19:07:02 UTC (rev 269061)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog	2020-10-27 19:17:43 UTC (rev 269062)
@@ -1,3 +1,13 @@
+2020-10-27  Philippe Normand  <[email protected]>
+
+        [GStreamer] Bad handling of audio files in the ImageDecoder
+        https://bugs.webkit.org/show_bug.cgi?id=218239
+
+        Reviewed by Adrian Perez de Castro.
+
+        * fast/images/animated-image-mp3-crash-expected.txt: Added.
+        * fast/images/animated-image-mp3-crash.html: Added.
+
 2020-10-13  Philippe Normand  <[email protected]>
 
         [GStreamer] Crash in WebCore::GStreamerRegistryScanner::isAVC1CodecSupported

Added: releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash-expected.txt (0 => 269062)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash-expected.txt	2020-10-27 19:17:43 UTC (rev 269062)
@@ -0,0 +1,10 @@
+Test that a mp3 media file loaded as an image should not crash.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Decoding an mp3 file triggers no crash
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash.html (0 => 269062)


--- releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.30/LayoutTests/fast/images/animated-image-mp3-crash.html	2020-10-27 19:17:43 UTC (rev 269062)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+    <body>
+        <img>
+        <script src=""
+        <script>
+         window.jsTestIsAsync = true;
+
+         function loadImage(src) {
+             return new Promise((resolve, reject) => {
+                 const image = document.querySelector('img');
+                 image.src = ""
+                 return image.decode().then(() => { resolve(image); }).catch((error) => { reject(error); });
+             });
+         }
+
+         function endTest() {
+             finishJSTest();
+             if (window.testRunner)
+                 testRunner.notifyDone();
+         }
+
+         description('Test that a mp3 media file loaded as an image should not crash.')
+
+         loadImage("../../media/content/silence.mp3").then(image => {
+             testFailed("Decoding an mp3 file to an <img> is not expected to work");
+             endTest();
+         }).catch((error) => {
+             testPassed("Decoding an mp3 file triggers no crash");
+             endTest();
+         });
+        </script>
+        <script src=""
+    </body>
+</html>

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog (269061 => 269062)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog	2020-10-27 19:07:02 UTC (rev 269061)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog	2020-10-27 19:17:43 UTC (rev 269062)
@@ -1,3 +1,18 @@
+2020-10-27  Philippe Normand  <[email protected]>
+
+        [GStreamer] Bad handling of audio files in the ImageDecoder
+        https://bugs.webkit.org/show_bug.cgi?id=218239
+
+        Reviewed by Adrian Perez de Castro.
+
+        The final main thread notification needs to be blocking otherwise the decoder might get
+        disposed of too early.
+
+        Test: fast/images/animated-image-mp3-crash.html
+
+        * platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
+        (WebCore::ImageDecoderGStreamer::pushEncodedData):
+
 2020-10-05  Enrique Ocaña González  <[email protected]>
 
         [GTK][X11] WebProcess crash in WebCore::GLContextGLX::createPbufferContext() with NVidia proprietary drivers

Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp (269061 => 269062)


--- releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp	2020-10-27 19:07:02 UTC (rev 269061)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp	2020-10-27 19:17:43 UTC (rev 269062)
@@ -394,7 +394,7 @@
         }
     }
     m_innerDecoder = nullptr;
-    callOnMainThread([this] {
+    callOnMainThreadAndWait([&] {
         if (m_encodedDataStatusChangedCallback)
             m_encodedDataStatusChangedCallback(encodedDataStatus());
     });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to