Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp

Issue 2223613002: WaveShaperNode should copy its curve. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp
index 3ad18dff95ecf83ca31c08f8dd43b0fb2515872d..9239d9d5368cdd3e07d78ae573c94e47d8d1bc7f 100644
--- a/third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.cpp
@@ -51,7 +51,14 @@ void WaveShaperProcessor::setCurve(DOMFloat32Array* curve)
// This synchronizes with process().
MutexLocker processLocker(m_processLock);
- m_curve = curve;
+ // Copy the curve data, if any, to our internal buffer.
+ if (!curve) {
+ m_curve = nullptr;
+ return;
+ }
+
+ m_curve = wrapUnique(new Vector<float>(curve->length()));
+ memcpy(m_curve->data(), curve->data(), sizeof(float)*curve->length());
}
void WaveShaperProcessor::setOversample(OverSampleType oversample)
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/WaveShaperProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698