Skip to content

Commit

Permalink
Bugfix: prevent borked generated audio file if meetecho header is pre…
Browse files Browse the repository at this point in the history
…sent with no RTP data next
  • Loading branch information
SamyCookie committed Sep 9, 2020
1 parent f3eb0d7 commit 8338595
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion postprocessing/janus-pp-rec.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,12 @@ int main(int argc, char *argv[])
continue;
}
/* Only read RTP header */
bytes = fread(prebuffer, sizeof(char), len > 24 ? 24: len, file);
uint16_t rtp_header_len = len > 24 ? 24: len;
bytes = fread(prebuffer, sizeof(char), rtp_header_len, file);
if (bytes < rtp_header_len) {
JANUS_LOG(LOG_WARN, "Missing RTP packet header data (%i instead %i)\n", bytes, rtp_header_len);
break;
}
janus_pp_rtp_header *rtp = (janus_pp_rtp_header *)prebuffer;
JANUS_LOG(LOG_VERB, " -- RTP packet (ssrc=%"SCNu32", pt=%"SCNu16", ext=%"SCNu16", seq=%"SCNu16", ts=%"SCNu32")\n",
ntohl(rtp->ssrc), rtp->type, rtp->extension, ntohs(rtp->seq_number), ntohl(rtp->timestamp));
Expand Down

0 comments on commit 8338595

Please sign in to comment.