summaryrefslogtreecommitdiff
path: root/gst/rtp/gstrtpgstdepay.c
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2014-11-20 13:14:14 +0100
committerWim Taymans <wtaymans@redhat.com>2014-11-20 13:14:14 +0100
commit3d7b0f30d748ad1c8e2c5d3528bfbdfe21cfde60 (patch)
tree00bd49f25bfe021ab675382a1200bd140ab69982 /gst/rtp/gstrtpgstdepay.c
parent9d2902d978905acf3ecc88dd331b20072dc9eab0 (diff)
downloadgstreamer-plugins-good-3d7b0f30d748ad1c8e2c5d3528bfbdfe21cfde60.tar.gz
rtpgstpay: put 0-byte at the end of events
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
Diffstat (limited to 'gst/rtp/gstrtpgstdepay.c')
-rw-r--r--gst/rtp/gstrtpgstdepay.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/rtp/gstrtpgstdepay.c b/gst/rtp/gstrtpgstdepay.c
index a34088025..621aa4758 100644
--- a/gst/rtp/gstrtpgstdepay.c
+++ b/gst/rtp/gstrtpgstdepay.c
@@ -279,7 +279,12 @@ read_event (GstRtpGSTDepay * rtpgstdepay, guint type,
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]);