rtpgstdepay: Properly handle backward compat for event deserialization

Actual code is checking for a NULL terminator and a ';' terminator,
for backward compat, in a chained way that cause all events being rejected.
The proper condition is to reject the events when terminator isn't
in ['\0', ';'] set.

https://bugzilla.gnome.org/show_bug.cgi?id=758151
This commit is contained in:
Josep Torra 2015-11-15 17:16:29 -08:00
parent f8b9360dad
commit 84b6743cf8

View file

@ -282,10 +282,9 @@ read_event (GstRtpGSTDepay * rtpgstdepay, guint type,
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] != ';')
if (map.data[offset + length - 1] != '\0'
&& map.data[offset + length - 1] != ';')
goto invalid_buffer;
GST_DEBUG_OBJECT (rtpgstdepay, "parsing event %s", &map.data[offset]);