Fixed bug in RTCP: packing error causing size mismatch when compiled with MSVC
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@382 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
9a0eab59c8
commit
46ca996b91
|
@ -37,6 +37,8 @@ PJ_BEGIN_DECL
|
|||
* @{
|
||||
*/
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/**
|
||||
* RTCP sender report.
|
||||
*/
|
||||
|
@ -100,7 +102,7 @@ struct pjmedia_rtcp_common
|
|||
unsigned version:2; /**< packet type */
|
||||
unsigned pt:8; /**< payload type */
|
||||
#endif
|
||||
pj_uint16_t length; /**< packet length */
|
||||
unsigned length:16; /**< packet length */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -124,6 +126,9 @@ struct pjmedia_rtcp_pkt
|
|||
typedef struct pjmedia_rtcp_pkt pjmedia_rtcp_pkt;
|
||||
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
/**
|
||||
* NTP time representation.
|
||||
*/
|
||||
|
|
|
@ -1105,8 +1105,10 @@ static int media_thread(void *arg)
|
|||
if (status != PJ_SUCCESS)
|
||||
app_perror(THIS_FILE, "Error receiving RTCP packet", status);
|
||||
else {
|
||||
if (size > sizeof(strm->rem_rtcp)) {
|
||||
PJ_LOG(3,(THIS_FILE, "Error: RTCP packet too large"));
|
||||
if (size != sizeof(strm->rem_rtcp)) {
|
||||
PJ_LOG(3,(THIS_FILE, "Error: RTCP packet size mismatch "
|
||||
"(recv %d bytes, expecting %d)",
|
||||
size, sizeof(strm->rem_rtcp)));
|
||||
status = -1;
|
||||
} else {
|
||||
pj_memcpy(&strm->rem_rtcp, packet, size);
|
||||
|
|
Loading…
Reference in New Issue