[MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
authoraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 18:01:58 +0000 (18:01 +0000)
committeraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2018 18:01:58 +0000 (18:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180253

Right now it's checked that start <= end but it's not checked that
neither of them is undefined.

When this happens, the bug can be hard to track down.

The assertion is not enabled for Mac because there is currently a test
that is hitting it.

Reviewed by Jer Noble.

* platform/graphics/PlatformTimeRanges.cpp:
(WebCore::PlatformTimeRanges::add):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230584 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/PlatformTimeRanges.cpp

index 8dda55b..82d860a 100644 (file)
@@ -1,3 +1,21 @@
+2018-04-12  Alicia Boya GarcĂ­a  <aboya@igalia.com>
+
+        [MSE] Add isValid() assertions on PlatformTimeRanges::add() range ends
+        https://bugs.webkit.org/show_bug.cgi?id=180253
+
+        Right now it's checked that start <= end but it's not checked that
+        neither of them is undefined.
+
+        When this happens, the bug can be hard to track down.
+
+        The assertion is not enabled for Mac because there is currently a test
+        that is hitting it.
+
+        Reviewed by Jer Noble.
+
+        * platform/graphics/PlatformTimeRanges.cpp:
+        (WebCore::PlatformTimeRanges::add):
+
 2018-04-12  Chris Dumez  <cdumez@apple.com>
 
         Process::setIdentifier() / Process::identifier() do not need a lock
index c7b9784..d2fd62e 100644 (file)
@@ -134,7 +134,12 @@ MediaTime PlatformTimeRanges::maximumBufferedTime() const
 
 void PlatformTimeRanges::add(const MediaTime& start, const MediaTime& end)
 {
+#if !PLATFORM(MAC) // https://bugs.webkit.org/show_bug.cgi?id=180253
+    ASSERT(start.isValid());
+    ASSERT(end.isValid());
+#endif
     ASSERT(start <= end);
+
     unsigned overlappingArcIndex;
     Range addedRange(start, end);