dash: mpdclient: fix divide by 0 if segment has no duration
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Mon, 17 Apr 2023 09:36:55 +0000 (11:36 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 18 Apr 2023 08:03:26 +0000 (09:03 +0100)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4441>

subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c
subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c

index 60a523c..7ee8538 100644 (file)
@@ -1768,7 +1768,7 @@ gst_mpd_client_stream_seek (GstMPDClient * client, GstActiveStream * stream,
 
     g_return_val_if_fail (GST_MPD_MULT_SEGMENT_BASE_NODE
         (stream->cur_seg_template)->SegmentTimeline == NULL, FALSE);
-    if (!GST_CLOCK_TIME_IS_VALID (duration)) {
+    if (!GST_CLOCK_TIME_IS_VALID (duration) || duration == 0) {
       return FALSE;
     }
 
index c245012..a5c2aee 100644 (file)
@@ -1770,7 +1770,7 @@ gst_mpd_client2_stream_seek (GstMPDClient2 * client, GstActiveStream * stream,
 
     g_return_val_if_fail (GST_MPD_MULT_SEGMENT_BASE_NODE
         (stream->cur_seg_template)->SegmentTimeline == NULL, FALSE);
-    if (!GST_CLOCK_TIME_IS_VALID (duration)) {
+    if (!GST_CLOCK_TIME_IS_VALID (duration) || duration == 0) {
       return FALSE;
     }