rtp: Avoid memcpy(len=0)

Change-Id: I7618c6509b67465d21271ea632bccc8cf11e4852
This commit is contained in:
Pau Espin 2022-08-11 20:31:18 +02:00
parent e95ad0e66e
commit c8241421bc
1 changed files with 2 additions and 1 deletions

View File

@ -199,7 +199,8 @@ osmo_rtp_build(struct osmo_rtp_handle *h, uint8_t payload_type,
rtph->timestamp = htonl(h->tx.timestamp);
h->tx.timestamp += duration;
rtph->ssrc = htonl(h->tx.ssrc);
memcpy(msg->data + sizeof(struct rtp_hdr), data, payload_len);
if (payload_len > 0)
memcpy(msg->data + sizeof(struct rtp_hdr), data, payload_len);
msgb_put(msg, sizeof(struct rtp_hdr) + payload_len);
return msg;