stream_write() can be used with a NULL packet to write padding only to
a stream. In the case of a metadata stream, packet is assumed to
always be non-NULL which may not always be true.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
if (stream->is_metadata) {
- stream->metadata_received += packet->size + padding_len;
+ stream->metadata_received += packet ? packet->size : 0;
+ stream->metadata_received += padding_len;
}
DBG("Wrote to %sstream %" PRIu64 ": data_length = %zu, padding_length = %zu",