mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
rtspsrc: sanity checks on range info
A max range that overflows should not be trusted, nor should a max range that equals the min range. Fixes #580851.(a).
This commit is contained in:
parent
56656dd03d
commit
20c7be5741
1 changed files with 11 additions and 0 deletions
|
@ -4389,6 +4389,17 @@ gst_rtspsrc_parse_range (GstRTSPSrc * src, const gchar * range,
|
|||
GST_DEBUG_OBJECT (src, "range: max %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (seconds));
|
||||
|
||||
/* live (WMS) server might send overflowed large max as its idea of infinity,
|
||||
* compensate to prevent problems later on */
|
||||
if (seconds != -1 && seconds < 0) {
|
||||
seconds = -1;
|
||||
GST_DEBUG_OBJECT (src, "insane range, set to NONE");
|
||||
}
|
||||
|
||||
/* live (WMS) might send min == max, which is not worth recording */
|
||||
if (segment->duration == -1 && seconds == segment->start)
|
||||
seconds = -1;
|
||||
|
||||
/* don't change duration with unknown value, we might have a valid value
|
||||
* there that we want to keep. */
|
||||
if (seconds != -1)
|
||||
|
|
Loading…
Reference in a new issue