Skip to content

Commit

Permalink
satip server: the data must for satip_rtp_tcp_data() must be allocate…
Browse files Browse the repository at this point in the history
…d, fixes #4573
  • Loading branch information
perexg committed Sep 14, 2017
1 parent 7319fa5 commit 9566406
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/satip/rtp.c
Expand Up @@ -907,7 +907,7 @@ satip_rtcp_thread(void *aux)
{
satip_rtp_session_t *rtp;
int64_t us;
uint8_t msg[RTCP_PAYLOAD+1];
uint8_t msg[RTCP_PAYLOAD+1], *msg1;
char addrbuf[50];
int r, len, err;

Expand All @@ -932,8 +932,15 @@ satip_rtcp_thread(void *aux)
tvhtrace(LS_SATIPS, "RTCP send to %s:%d : %s", addrbuf, ntohs(IP_PORT(rtp->peer2)), msg + 16);
}
if (rtp->port == RTSP_TCP_DATA) {
err = satip_rtp_tcp_data(rtp, 1, msg, len);
r = err ? -1 : 0;
msg1 = malloc(len);
if (msg1) {
memcpy(msg1, msg, len);
err = satip_rtp_tcp_data(rtp, 1, msg1, len);
r = err ? -1 : 0;
} else {
r = -1;
err = ENOMEM;
}
} else {
r = sendto(rtp->fd_rtcp, msg, len, 0,
(struct sockaddr*)&rtp->peer2,
Expand Down

0 comments on commit 9566406

Please sign in to comment.