Title: [282526] releases/WebKitGTK/webkit-2.32/Source/WebCore
Revision
282526
Author
[email protected]
Date
2021-09-16 03:09:16 -0700 (Thu, 16 Sep 2021)

Log Message

Merge r277821 - WebAudioBufferList::setSampleCount() should early return if computeBufferSizes() fails
https://bugs.webkit.org/show_bug.cgi?id=226028
rdar://78222414

Reviewed by Eric Carlson.

If computeBufferSizes() fails (returns WTF::nullopt), we now early return on release
builds, without modifying the WebAudioBufferList's internal state in any way. In
Debug, we would still hit the assertion.

* platform/audio/cocoa/WebAudioBufferList.cpp:
(WebCore::WebAudioBufferList::setSampleCount):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (282525 => 282526)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-09-16 10:01:25 UTC (rev 282525)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog	2021-09-16 10:09:16 UTC (rev 282526)
@@ -1,3 +1,18 @@
+2021-05-20  Chris Dumez  <[email protected]>
+
+        WebAudioBufferList::setSampleCount() should early return if computeBufferSizes() fails
+        https://bugs.webkit.org/show_bug.cgi?id=226028
+        rdar://78222414
+
+        Reviewed by Eric Carlson.
+
+        If computeBufferSizes() fails (returns WTF::nullopt), we now early return on release
+        builds, without modifying the WebAudioBufferList's internal state in any way. In
+        Debug, we would still hit the assertion.
+
+        * platform/audio/cocoa/WebAudioBufferList.cpp:
+        (WebCore::WebAudioBufferList::setSampleCount):
+
 2021-05-18  Alan Bujtas  <[email protected]>
 
         The containing block for a fixed renderer has to be a type of RenderBlock

Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/audio/cocoa/WebAudioBufferList.cpp (282525 => 282526)


--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/audio/cocoa/WebAudioBufferList.cpp	2021-09-16 10:01:25 UTC (rev 282525)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/audio/cocoa/WebAudioBufferList.cpp	2021-09-16 10:09:16 UTC (rev 282526)
@@ -91,11 +91,13 @@
     if (!sampleCount || m_sampleCount == sampleCount)
         return;
 
+    auto bufferSizes = computeBufferSizes(m_channelCount, m_bytesPerFrame, m_canonicalList->mNumberBuffers, sampleCount);
+    ASSERT(bufferSizes);
+    if (!bufferSizes)
+        return;
+
     m_sampleCount = sampleCount;
 
-    auto bufferSizes = computeBufferSizes(m_channelCount, m_bytesPerFrame, m_canonicalList->mNumberBuffers, m_sampleCount);
-    ASSERT(bufferSizes);
-
     m_flatBuffer.resize(bufferSizes->second);
     auto* data = ""
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to