Title: [236187] releases/WebKitGTK/webkit-2.22/Source/WebCore
Revision
236187
Author
carlo...@webkit.org
Date
2018-09-19 06:19:20 -0700 (Wed, 19 Sep 2018)

Log Message

Merge r235848 - [GStreamer] Fix overflow in buffered ranges
https://bugs.webkit.org/show_bug.cgi?id=189419

Reviewed by Philippe Normand.

Scale operations on big numbers (like media timestamps or durations)
should be made with GStreamer utility functions to avoid overflows.

This fixes an assertion when a 24 hour long fragmented MP4 file is
played.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::buffered const):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog (236186 => 236187)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-19 13:19:14 UTC (rev 236186)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog	2018-09-19 13:19:20 UTC (rev 236187)
@@ -1,3 +1,19 @@
+2018-09-10  Alicia Boya GarcĂ­a  <ab...@igalia.com>
+
+        [GStreamer] Fix overflow in buffered ranges
+        https://bugs.webkit.org/show_bug.cgi?id=189419
+
+        Reviewed by Philippe Normand.
+
+        Scale operations on big numbers (like media timestamps or durations)
+        should be made with GStreamer utility functions to avoid overflows.
+
+        This fixes an assertion when a 24 hour long fragmented MP4 file is
+        played.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::buffered const):
+
 2018-09-10  Philippe Normand  <pnorm...@igalia.com>
 
         [GStreamer] Several media related tests timing out around the same revision

Modified: releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (236186 => 236187)


--- releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2018-09-19 13:19:14 UTC (rev 236186)
+++ releases/WebKitGTK/webkit-2.22/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2018-09-19 13:19:20 UTC (rev 236187)
@@ -1125,8 +1125,9 @@
     for (guint index = 0; index < numBufferingRanges; index++) {
         gint64 rangeStart = 0, rangeStop = 0;
         if (gst_query_parse_nth_buffering_range(query, index, &rangeStart, &rangeStop)) {
-            timeRanges->add(MediaTime(rangeStart * toGstUnsigned64Time(mediaDuration) / GST_FORMAT_PERCENT_MAX, GST_SECOND),
-                MediaTime(rangeStop * toGstUnsigned64Time(mediaDuration) / GST_FORMAT_PERCENT_MAX, GST_SECOND));
+            uint64_t startTime = gst_util_uint64_scale_int_round(toGstUnsigned64Time(mediaDuration), rangeStart, GST_FORMAT_PERCENT_MAX);
+            uint64_t stopTime = gst_util_uint64_scale_int_round(toGstUnsigned64Time(mediaDuration), rangeStop, GST_FORMAT_PERCENT_MAX);
+            timeRanges->add(MediaTime(startTime, GST_SECOND), MediaTime(stopTime, GST_SECOND));
         }
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to