[pulseaudio-discuss,2/3] rtp: Fix typo in the chunk length calculation

Submitted by Cédric Schieli on May 9, 2016, 9:33 a.m.

Details

Message ID 1462786434-18477-3-git-send-email-cschieli@gmail.com
State New
Headers show
Series "rtp-recv: interoperability fixes" ( rev: 1 ) in PulseAudio

Not browsing as part of any series.

Commit Message

Cédric Schieli May 9, 2016, 9:33 a.m.
Although it should not trigger too often (cc is almost always 0) the
length calculation is obviously wrong here.

Signed-off-by: Cédric Schieli <cschieli@gmail.com>
---
 src/modules/rtp/rtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index 17c8d3c..170ce96 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -281,7 +281,7 @@  int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, struct
     }
 
     chunk->index += 12 + cc*4;
-    chunk->length = (size_t) size - 12 + cc*4;
+    chunk->length = (size_t) size - 12 - cc*4;
 
     if (chunk->length % c->frame_size != 0) {
         pa_log_warn("Bad RTP packet size.");