summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>2023-04-17 11:36:55 +0200
committerTim-Philipp Müller <tim@centricular.com>2023-04-18 09:03:26 +0100
commit0b8a9bfd51ac92073ba40b9bb5268b5e2f4ed30d (patch)
tree38b7ed7119384333b951201a947c2f9a24bd354f
parent2c7a8739dd38055d06d8b876ca9f063c7720fa44 (diff)
downloadgstreamer-0b8a9bfd51ac92073ba40b9bb5268b5e2f4ed30d.tar.gz
dash: mpdclient: fix divide by 0 if segment has no duration
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4441>
-rw-r--r--subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c2
-rw-r--r--subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c b/subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c
index 60a523c201..7ee85382be 100644
--- a/subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c
+++ b/subprojects/gst-plugins-bad/ext/dash/gstmpdclient.c
@@ -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;
}
diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c
index c245012ed0..a5c2aeef45 100644
--- a/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c
+++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/dash/gstmpdclient.c
@@ -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;
}