Title: [219736] trunk/Source/WebCore
Revision
219736
Author
[email protected]
Date
2017-07-21 12:48:48 -0700 (Fri, 21 Jul 2017)

Log Message

Noise when AudioChannel lengths don't match.
https://bugs.webkit.org/show_bug.cgi?id=174706
rdar://problem/33389856

Patch by Jeremy Jones <[email protected]> on 2017-07-21
Reviewed by Eric Carlson.

When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
This change zeros out the data, so there isn't objectionable noise sent to the speaker.

* platform/audio/AudioChannel.cpp:
(WebCore::AudioChannel::copyFrom):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (219735 => 219736)


--- trunk/Source/WebCore/ChangeLog	2017-07-21 19:39:57 UTC (rev 219735)
+++ trunk/Source/WebCore/ChangeLog	2017-07-21 19:48:48 UTC (rev 219736)
@@ -1,3 +1,17 @@
+2017-07-21  Jeremy Jones  <[email protected]>
+
+        Noise when AudioChannel lengths don't match.
+        https://bugs.webkit.org/show_bug.cgi?id=174706
+        rdar://problem/33389856
+
+        Reviewed by Eric Carlson.
+
+        When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
+        This change zeros out the data, so there isn't objectionable noise sent to the speaker.
+
+        * platform/audio/AudioChannel.cpp:
+        (WebCore::AudioChannel::copyFrom):
+
 2017-07-21  Sam Weinig  <[email protected]>
 
         [WebIDL] Make a few parameters non-nullable in inspector IDL files

Modified: trunk/Source/WebCore/platform/audio/AudioChannel.cpp (219735 => 219736)


--- trunk/Source/WebCore/platform/audio/AudioChannel.cpp	2017-07-21 19:39:57 UTC (rev 219735)
+++ trunk/Source/WebCore/platform/audio/AudioChannel.cpp	2017-07-21 19:48:48 UTC (rev 219736)
@@ -59,10 +59,8 @@
 {
     bool isSafe = (sourceChannel && sourceChannel->length() >= length());
     ASSERT(isSafe);
-    if (!isSafe)
-        return;
 
-    if (sourceChannel->isSilent()) {
+    if (!isSafe || sourceChannel->isSilent()) {
         zero();
         return;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to