rtpgstdepay: Properly handle backward compat for event deserialization
authorJosep Torra <n770galaxy@gmail.com>
Mon, 16 Nov 2015 01:16:29 +0000 (17:16 -0800)
committerJosep Torra <n770galaxy@gmail.com>
Wed, 18 Nov 2015 01:24:28 +0000 (17:24 -0800)
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

gst/rtp/gstrtpgstdepay.c

index aaea3d4..5c1476a 100644 (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]);