Title: [272272] branches/safari-611-branch/Source/WebCore
Revision
272272
Author
[email protected]
Date
2021-02-02 17:40:47 -0800 (Tue, 02 Feb 2021)

Log Message

Cherry-pick r271733. rdar://problem/73887744

    Protect against sampleRate being 0 in IIRFilter::tailTime()
    https://bugs.webkit.org/show_bug.cgi?id=220837
    <rdar://73395924>

    Reviewed by Eric Carlson.

    * platform/audio/IIRFilter.cpp:
    (WebCore::IIRFilter::tailTime):
    Return early if sampleRate is 0 (invalid). Add a release assertion to make
    sure that numberOfBlocks is greater than 0 since this is the size of the
    |magnitude| array and we access magnitude[0] later on.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271733 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272271 => 272272)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-03 01:40:44 UTC (rev 272271)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-03 01:40:47 UTC (rev 272272)
@@ -1,5 +1,38 @@
 2021-02-02  Alan Coon  <[email protected]>
 
+        Cherry-pick r271733. rdar://problem/73887744
+
+    Protect against sampleRate being 0 in IIRFilter::tailTime()
+    https://bugs.webkit.org/show_bug.cgi?id=220837
+    <rdar://73395924>
+    
+    Reviewed by Eric Carlson.
+    
+    * platform/audio/IIRFilter.cpp:
+    (WebCore::IIRFilter::tailTime):
+    Return early if sampleRate is 0 (invalid). Add a release assertion to make
+    sure that numberOfBlocks is greater than 0 since this is the size of the
+    |magnitude| array and we access magnitude[0] later on.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-21  Chris Dumez  <[email protected]>
+
+            Protect against sampleRate being 0 in IIRFilter::tailTime()
+            https://bugs.webkit.org/show_bug.cgi?id=220837
+            <rdar://73395924>
+
+            Reviewed by Eric Carlson.
+
+            * platform/audio/IIRFilter.cpp:
+            (WebCore::IIRFilter::tailTime):
+            Return early if sampleRate is 0 (invalid). Add a release assertion to make
+            sure that numberOfBlocks is greater than 0 since this is the size of the
+            |magnitude| array and we access magnitude[0] later on.
+
+2021-02-02  Alan Coon  <[email protected]>
+
         Cherry-pick r271696. rdar://problem/73887913
 
     Check for TURN username/credentials sizes in RTCPeerConnection constructor

Modified: branches/safari-611-branch/Source/WebCore/platform/audio/IIRFilter.cpp (272271 => 272272)


--- branches/safari-611-branch/Source/WebCore/platform/audio/IIRFilter.cpp	2021-02-03 01:40:44 UTC (rev 272271)
+++ branches/safari-611-branch/Source/WebCore/platform/audio/IIRFilter.cpp	2021-02-03 01:40:47 UTC (rev 272272)
@@ -172,7 +172,7 @@
     // If filter is not stable, just return max tail. Since the filter is not
     // stable, the impulse response won't converge to zero, so we don't need to
     // find the impulse response to find the actual tail time.
-    if (!isFilterStable)
+    if (!isFilterStable || !sampleRate)
         return maxTailTime;
 
     // How to compute the tail time? We're going to filter an impulse
@@ -188,6 +188,7 @@
 
     // Number of render quanta needed to reach the max tail time.
     int numberOfBlocks = std::ceil(sampleRate * maxTailTime / AudioUtilities::renderQuantumSize);
+    RELEASE_ASSERT(numberOfBlocks);
 
     // Input and output buffers for filtering.
     AudioFloatArray input(AudioUtilities::renderQuantumSize);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to