if (!read_length (rtpgstdepay, map.data, map.size, &length, &offset))
goto too_small;
+ if (length == 0 || map.data[offset + length - 1] != '\0')
+ goto invalid_buffer;
+
GST_DEBUG_OBJECT (rtpgstdepay, "parsing caps %s", &map.data[offset]);
/* parse and store in cache */
gst_buffer_unmap (buf, &map);
return NULL;
}
+invalid_buffer:
+ {
+ GST_ELEMENT_WARNING (rtpgstdepay, STREAM, DECODE,
+ ("caps string not 0-terminated."), (NULL));
+ gst_buffer_unmap (buf, &map);
+ return NULL;
+ }
}
static GstEvent *
if (!read_length (rtpgstdepay, map.data, map.size, &length, &offset))
goto too_small;
+ if (length == 0 || map.data[offset + length - 1] != ';')
+ goto invalid_buffer;
+
GST_DEBUG_OBJECT (rtpgstdepay, "parsing event %s", &map.data[offset]);
/* parse */
gst_buffer_unmap (buf, &map);
return NULL;
}
+invalid_buffer:
+ {
+ GST_ELEMENT_WARNING (rtpgstdepay, STREAM, DECODE,
+ ("event string not 0-terminated."), (NULL));
+ gst_buffer_unmap (buf, &map);
+ return NULL;
+ }
parse_failed:
{
GST_WARNING_OBJECT (rtpgstdepay, "could not parse event");