mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1114348 - Use mozilla::IsNaN() in Web Audio code; r=padenot
--HG-- extra : rebase_source : 0acc0643ed6a8800d02557f6e84312955e34a59e
This commit is contained in:
parent
35b8e4d189
commit
b7f57788cf
@ -7,6 +7,7 @@
|
||||
#include "AudioBufferSourceNode.h"
|
||||
#include "mozilla/dom/AudioBufferSourceNodeBinding.h"
|
||||
#include "mozilla/dom/AudioParam.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "AudioNodeEngine.h"
|
||||
#include "AudioNodeStream.h"
|
||||
@ -110,7 +111,7 @@ public:
|
||||
mBeginProcessing = mStart + 0.5;
|
||||
break;
|
||||
case AudioBufferSourceNode::DOPPLERSHIFT:
|
||||
mDopplerShift = aParam > 0 && aParam == aParam ? aParam : 1.0;
|
||||
mDopplerShift = (aParam <= 0 || mozilla::IsNaN(aParam)) ? 1.0 : aParam;
|
||||
break;
|
||||
default:
|
||||
NS_ERROR("Bad AudioBufferSourceNodeEngine double parameter.");
|
||||
@ -415,7 +416,7 @@ public:
|
||||
} else {
|
||||
playbackRate = mPlaybackRateTimeline.GetValueAtTime(mSource->GetCurrentPosition());
|
||||
}
|
||||
if (playbackRate <= 0 || playbackRate != playbackRate) {
|
||||
if (playbackRate <= 0 || mozilla::IsNaN(playbackRate)) {
|
||||
playbackRate = 1.0f;
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ namespace WebAudioUtils {
|
||||
static_assert(mozilla::IsFloatingPoint<FloatType>::value == true,
|
||||
"FloatType must be a floating point type");
|
||||
|
||||
if (f != f) {
|
||||
if (mozilla::IsNaN(f)) {
|
||||
// It is the responsibility of the caller to deal with NaN values.
|
||||
// If we ever get to this point, we have a serious bug to fix.
|
||||
NS_RUNTIMEABORT("We should never see a NaN here");
|
||||
|
Loading…
Reference in New Issue
Block a user