[Bug 751735] New: dashdemux: incorrect parsing and handling of segment templates

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Jun 30 08:02:01 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=751735

            Bug ID: 751735
           Summary: dashdemux: incorrect parsing and handling of segment
                    templates
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: florin.apostol at oregan.net
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

The gst_mpdparser_build_URL_from_template function does not correctly parse and
validate the template. For some templates it will accept a wrong format and
provide a wrong output.

The function will split the url template into tokens separated by $. 
The main problem is that the function will try to match and replace any of
these tokens, instead of analysing only the ones contained between 2 $
characters.
More precisely, for a string like token0$token1$token2$token3$token4 only the
odd number tokens (1,3,5,...) should be analysed, because only those have the
format $<identifier>$.
For example, token0 does not have a preceding $, so it cannot be an identifier.

Another problem is the validation of format done by validate_format function.
It should reject formats that do not start with %. Instead, it will accept
them, leading to strange output produced by
gst_mpdparser_build_URL_from_template function.

The following scenarios are not correctly handled.
The format of the examples is: uri_template, expected response. 
  const gchar *id = "TestId";
  guint number = 7;
  guint bandwidth = 2500;
  guint64 time = 100;

{"Number", "Number"},       /* string similar with an identifier, but without $
*/
{"Number$Number$", "Number7"},      /* Number identifier */
{"Number$Number$$$", "Number7$"},   /* Number identifier followed by $$ */
{"Number$Number$Number$Number$", "Number7Number7"}, /* series of "Number"
string and Number identifier */
{"TestMedia$Time", NULL},   /* Identifier not finished with $ */
{"Time$Time%0d$", "Time100"},       /* usage of format smaller than number of
digits */
{"Time$Time%01d$", "Time100"},      /* usage of format smaller than number of
digits */
{"Time$Time%05d$", "Time00100"},    /* usage of format bigger than number of
digits */
{"Time$Time%05dtest$", "Time00100test"},    /* usage extra text in format */
{"Time$Time1%01d$", NULL},  /* incorrect format: does not start with % after
identifier */
{"$RepresentationID1$", NULL},      /* incorrect identifier */
{"$Bandwidth1$", NULL},     /* incorrect identifier */
{"$Number1$", NULL},        /* incorrect identifier */
{"$RepresentationID%01d$", NULL},   /* incorrect format: RepresentationID does
not support formatting */
{"Time$Time%05u$", "Time00100"},    /* %u format */
{"Time$Time%05x$", "Time00064"},    /* %x format */
{"Time$Time%05utest$", "Time00100test"},    /* %u format followed by text */
{"Time$Time%05xtest$", "Time00064test"},    /* %x format followed by text */

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list