mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 21:13:44 +00:00
rtp_proxy.c: Ensure msgb_alloc is large enough for largest AMR frame
In AMR 12.2 (mode 7), the actual RTP payload is 33 bytes. Howeerver, as we store the length of the (dynamically-sized) AMR payload in the first byte, our buffer needs at least 33+1 byte in size.
This commit is contained in:
committed by
Neels Hofmeyr
parent
5331cf8dbd
commit
8291623054
@@ -172,7 +172,7 @@ static int rtp_decode(struct msgb *msg, uint32_t callref, struct msgb **data)
|
||||
/* always allocate for the maximum possible size to avoid
|
||||
* fragmentation */
|
||||
new_msg = msgb_alloc(sizeof(struct gsm_data_frame) +
|
||||
MAX_RTP_PAYLOAD_LEN, "GSM-DATA (TCH)");
|
||||
MAX_RTP_PAYLOAD_LEN+1, "GSM-DATA (TCH)");
|
||||
|
||||
if (!new_msg)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user