]> code.delx.au - pulseaudio/commitdiff
rtp: Fix bracketing in pa_rtp_recv.
authorColin Guthrie <cguthrie@mandriva.org>
Sat, 8 May 2010 12:47:19 +0000 (13:47 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Sat, 8 May 2010 13:21:52 +0000 (14:21 +0100)
The syntactically correct error meant that the timestamp was always
marked as found and only the first header was checked.

In the case where the timestamp was the first header, things
would have worked as expected.

Thanks to pino for reporting via bug refs #818

src/modules/rtp/rtp.c

index 6706a10f71feb794337888a87b8c22c46ed7d565..74f0ac389de527b2c4a64d0e88f7324b02874aea 100644 (file)
@@ -278,8 +278,8 @@ int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, struct
         pa_memchunk_reset(&c->memchunk);
     }
 
-    for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm)) {
-        if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP)
+    for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
+        if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SO_TIMESTAMP) {
             memcpy(tstamp, CMSG_DATA(cm), sizeof(struct timeval));
             found_tstamp = TRUE;
             break;