Put a 0-byte at the end of the event string. Does not break ABI because
old depayloaders will skip the 0 byte (which is included in the length).
Expect a 0-byte at the end of the event string or a ; for old
payloaders.
See https://bugzilla.gnome.org/show_bug.cgi?id=737591
if (!read_length (rtpgstdepay, map.data, map.size, &length, &offset))
goto too_small;
- if (length == 0 || map.data[offset + length - 1] != ';')
+ if (length == 0)
+ goto invalid_buffer;
+ if (map.data[offset + length - 1] != '\0')
+ goto invalid_buffer;
+ /* backward compat, old payloader did not put 0-byte at the end */
+ if (map.data[offset + length - 1] != ';')
goto invalid_buffer;
GST_DEBUG_OBJECT (rtpgstdepay, "parsing event %s", &map.data[offset]);
estr = gst_structure_to_string (s);
elen = strlen (estr);
+ /* for 0 byte */
+ elen++;
outbuf = make_data_buffer (rtpgstpay, estr, elen);
GST_DEBUG_OBJECT (rtpgstpay, "sending event=%s", estr);
g_free (estr);