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

Unified Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 202423002: Fix SourceBuffer.timestampOffset setter behavior for invalid values. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add expectation file since it appears the trybots need it. Created 6 years, 9 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 | « LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « LayoutTests/http/tests/media/media-source/mediasource-timestamp-offset-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698