Fixed memleak when two voip blocks present in single rtcp packet.
BUG=chromium:603894 Review URL: https://codereview.webrtc.org/1901593002 Cr-Commit-Position: refs/heads/master@{#12413}
This commit is contained in:
@ -42,14 +42,13 @@ RTCPPacketInformation::RTCPPacketInformation()
|
|||||||
RTCPPacketInformation::~RTCPPacketInformation()
|
RTCPPacketInformation::~RTCPPacketInformation()
|
||||||
{
|
{
|
||||||
delete [] applicationData;
|
delete [] applicationData;
|
||||||
delete VoIPMetric;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
RTCPPacketInformation::AddVoIPMetric(const RTCPVoIPMetric* metric)
|
RTCPPacketInformation::AddVoIPMetric(const RTCPVoIPMetric* metric)
|
||||||
{
|
{
|
||||||
VoIPMetric = new RTCPVoIPMetric();
|
VoIPMetric.reset(new RTCPVoIPMetric());
|
||||||
memcpy(VoIPMetric, metric, sizeof(RTCPVoIPMetric));
|
memcpy(VoIPMetric.get(), metric, sizeof(RTCPVoIPMetric));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RTCPPacketInformation::AddApplicationData(const uint8_t* data,
|
void RTCPPacketInformation::AddApplicationData(const uint8_t* data,
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_HELP_H_
|
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_RECEIVER_HELP_H_
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "webrtc/base/constructormagic.h"
|
#include "webrtc/base/constructormagic.h"
|
||||||
@ -87,7 +88,7 @@ public:
|
|||||||
|
|
||||||
uint32_t xr_originator_ssrc;
|
uint32_t xr_originator_ssrc;
|
||||||
bool xr_dlrr_item;
|
bool xr_dlrr_item;
|
||||||
RTCPVoIPMetric* VoIPMetric;
|
std::unique_ptr<RTCPVoIPMetric> VoIPMetric;
|
||||||
|
|
||||||
rtc::scoped_ptr<rtcp::TransportFeedback> transport_feedback_;
|
rtc::scoped_ptr<rtcp::TransportFeedback> transport_feedback_;
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,7 @@ class RtcpReceiverTest : public ::testing::Test {
|
|||||||
rtcp_packet_info_.rtp_timestamp = rtcpPacketInformation.rtp_timestamp;
|
rtcp_packet_info_.rtp_timestamp = rtcpPacketInformation.rtp_timestamp;
|
||||||
rtcp_packet_info_.xr_dlrr_item = rtcpPacketInformation.xr_dlrr_item;
|
rtcp_packet_info_.xr_dlrr_item = rtcpPacketInformation.xr_dlrr_item;
|
||||||
if (rtcpPacketInformation.VoIPMetric)
|
if (rtcpPacketInformation.VoIPMetric)
|
||||||
rtcp_packet_info_.AddVoIPMetric(rtcpPacketInformation.VoIPMetric);
|
rtcp_packet_info_.AddVoIPMetric(rtcpPacketInformation.VoIPMetric.get());
|
||||||
rtcp_packet_info_.transport_feedback_.reset(
|
rtcp_packet_info_.transport_feedback_.reset(
|
||||||
rtcpPacketInformation.transport_feedback_.release());
|
rtcpPacketInformation.transport_feedback_.release());
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user