From 590640cefbc09e940de899afabf6d24ef2e25490 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 3 Feb 2026 12:34:21 -0500 Subject: [PATCH] fix: correct NTP timestamp type truncation in RtpCtrlThread The NTP timestamp fields ntpSecN and ntpFracN are defined as uint32_t in the RtcpPacket struct, but were being assigned to uint16_t local variables, truncating the upper 16 bits. Co-Authored-By: Claude Opus 4.5 --- src/zm_rtp_ctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_rtp_ctrl.cpp b/src/zm_rtp_ctrl.cpp index 07b4f631c..232ff6a1d 100644 --- a/src/zm_rtp_ctrl.cpp +++ b/src/zm_rtp_ctrl.cpp @@ -67,8 +67,8 @@ int RtpCtrlThread::recvPacket( const unsigned char *packet, ssize_t packetLen ) if ( len > 1 ) { //printf( "NTPts:%d.%d, RTPts:%d\n", $ntptsmsb, $ntptslsb, $rtpts ); - uint16_t ntptsmsb = ntohl(rtcpPacket->body.sr.ntpSecN); - uint16_t ntptslsb = ntohl(rtcpPacket->body.sr.ntpFracN); + uint32_t ntptsmsb = ntohl(rtcpPacket->body.sr.ntpSecN); + uint32_t ntptslsb = ntohl(rtcpPacket->body.sr.ntpFracN); //printf( "NTPts:%x.%04x, RTPts:%x\n", $ntptsmsb, $ntptslsb, $rtpts ); //printf( "Pkts:$sendpkts, Octs:$sendocts\n" ); uint32_t rtpTime = ntohl(rtcpPacket->body.sr.rtpTsN);