]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] rtp_common_write: Coverity 1227609 Calling risky function 2543/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 7 Jun 2024 11:50:56 +0000 (14:50 +0300)
committerAndrey Volk <andywolk@gmail.com>
Mon, 29 Jul 2024 14:02:42 +0000 (17:02 +0300)
src/switch_rtp.c

index 3d9e2ae624077707cba935ddbd22e1720ef02e06..a27703f4497d64a3ee3bd1dfc0329f346f057ba5 100644 (file)
@@ -8267,11 +8267,11 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
        if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
                int external = (flags && *flags & SFF_EXTERNAL);
                /* Normalize the timestamps to our own base by generating a made up starting point then adding the measured deltas to that base
-                  so if the timestamps and ssrc of the source change, it will not break the other end's jitter bufffer / decoder etc *cough* CHROME *cough*
+                  so if the timestamps and ssrc of the source change, it will not break the other end's jitter buffer / decoder etc *cough* CHROME *cough*
                 */
 
                if (!rtp_session->ts_norm.ts) {
-                       rtp_session->ts_norm.ts = (uint32_t) rand() % 1000000 + 1;
+                       rtp_session->ts_norm.ts = (uint32_t) switch_rand() % 1000000 + 1;
                }
 
                if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc || rtp_session->ts_norm.last_external != external) {