Index: Source/modules/mediasource/SourceBuffer.cpp |
diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp |
index c0d64a19a4fbc826d2c88a0836020271ba4cc64e..2730be3020d7163cb7ddba6e275189780b167965 100644 |
--- a/Source/modules/mediasource/SourceBuffer.cpp |
+++ b/Source/modules/mediasource/SourceBuffer.cpp |
@@ -175,6 +175,14 @@ double SourceBuffer::timestampOffset() const |
void SourceBuffer::setTimestampOffset(double offset, ExceptionState& exceptionState) |
{ |
+ // Enforce throwing an exception on restricted double values. |
+ if (std::isnan(offset) |
wolenetz
2014/03/17 20:11:39
nit: use !std::isfinite(offset)?
acolwell GONE FROM CHROMIUM
2014/03/17 20:28:27
Done.
|
+ || offset == std::numeric_limits<double>::infinity() |
+ || offset == -std::numeric_limits<double>::infinity()) { |
+ exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::notAFiniteNumber(offset)); |
+ 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 |