From 83dd8f88b79d494e4f3daff0d3b8909d36fca9e3 Mon Sep 17 00:00:00 2001 From: Dmytro Bogovych Date: Sun, 30 Oct 2022 18:36:06 +0300 Subject: [PATCH] - fix compiler warning + make debugging easier --- src/engine/media/MT_AudioReceiver.cpp | 5 ++++- src/libs/ice/ICEAddress.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/engine/media/MT_AudioReceiver.cpp b/src/engine/media/MT_AudioReceiver.cpp index 6e380549..e262774f 100644 --- a/src/engine/media/MT_AudioReceiver.cpp +++ b/src/engine/media/MT_AudioReceiver.cpp @@ -612,7 +612,10 @@ bool AudioReceiver::getAudio(Audio::DataWindow& output, int options, int* rate) // Handle here regular RTP packets // Check if payload length is ok - int tail = mCodec->rtpLength() ? p->rtp()->GetPayloadLength() % mCodec->rtpLength() : 0; + size_t payload_length = p->rtp()->GetPayloadLength(); + size_t rtp_frame_length = mCodec->rtpLength(); + + int tail = rtp_frame_length ? payload_length % rtp_frame_length : 0; if (!tail) { diff --git a/src/libs/ice/ICEAddress.cpp b/src/libs/ice/ICEAddress.cpp index 553e28c4..b20daec9 100644 --- a/src/libs/ice/ICEAddress.cpp +++ b/src/libs/ice/ICEAddress.cpp @@ -427,7 +427,7 @@ std::string NetworkAddress::ip() const { assert(mInitialized == true); - char resultbuf[160], ip6[160]; resultbuf[0] = 0; + char resultbuf[159], ip6[161]; resultbuf[0] = 0; #ifdef TARGET_WIN DWORD resultsize = sizeof(resultbuf);