Chromium Code Reviews| Index: Source/modules/mediasource/SourceBuffer.cpp |
| diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp |
| index c0d64a19a4fbc826d2c88a0836020271ba4cc64e..87c6cf1dc05fbe9d1903a4b3021d73d0fc56ec22 100644 |
| --- a/Source/modules/mediasource/SourceBuffer.cpp |
| +++ b/Source/modules/mediasource/SourceBuffer.cpp |
| @@ -175,6 +175,12 @@ double SourceBuffer::timestampOffset() const |
| void SourceBuffer::setTimestampOffset(double offset, ExceptionState& exceptionState) |
| { |
| + // Enforce throwing an exception on restricted double values. |
| + if (!std::isfinite(offset)) { |
| + exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::notAFiniteNumber(offset)); |
|
sof
2014/03/22 07:51:23
This isn't quite right per WebIDL, infinities and
|
| + return; |
| + } |
| + |
| // Section 3.1 timestampOffset attribute setter steps. |
| // 1. Let new timestamp offset equal the new value being assigned to this attribute. |
| // 2. If this object has been removed from the sourceBuffers attribute of the parent media source, then throw an |