Skip to content

Commit

Permalink
Update sdp.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sauwming authored Nov 3, 2023
1 parent 3d2fb85 commit 11902f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pjmedia/src/pjmedia/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,8 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && rtpmap && p_attr, PJ_EINVAL);

/* Check that mandatory attributes are specified. */
PJ_ASSERT_RETURN(rtpmap->enc_name.slen && rtpmap->clock_rate,
PJMEDIA_SDP_EINRTPMAP);
PJ_ASSERT_RETURN(rtpmap->pt.slen && rtpmap->enc_name.slen &&
rtpmap->clock_rate, PJMEDIA_SDP_EINRTPMAP);


attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
Expand All @@ -611,13 +611,13 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool,
len = pj_ansi_snprintf(tempbuf, sizeof(tempbuf),
"%.*s %.*s/%u%s%.*s",
(int)rtpmap->pt.slen,
rtpmap->pt.ptr ? rtpmap->pt.ptr : "(null)",
rtpmap->pt.ptr,
(int)rtpmap->enc_name.slen,
rtpmap->enc_name.ptr ? rtpmap->enc_name.ptr : "(null)",
rtpmap->enc_name.ptr,
rtpmap->clock_rate,
(rtpmap->param.slen ? "/" : ""),
(int)rtpmap->param.slen,
rtpmap->param.ptr ? rtpmap->param.ptr : "(null)");
rtpmap->param.slen ? rtpmap->param.ptr : "");

if (len < 1 || len >= (int)sizeof(tempbuf))
return PJMEDIA_SDP_ERTPMAPTOOLONG;
Expand Down

0 comments on commit 11902f6

Please sign in to comment.