1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05:00

RTPSink: nullify m_byteBuffer after delete

This commit is contained in:
f4exb 2023-07-07 04:57:18 +02:00
parent f414c1284f
commit 768d3f1398

View File

@ -66,8 +66,10 @@ RTPSink::~RTPSink()
qrtplib::RTPTime delay = qrtplib::RTPTime(10.0);
m_rtpSession.BYEDestroy(delay, "Time's up", 9);
if (m_byteBuffer) {
if (m_byteBuffer)
{
delete[] m_byteBuffer;
m_byteBuffer = nullptr;
}
}
@ -127,8 +129,10 @@ void RTPSink::setPayloadInformation(PayloadType payloadType, int sampleRate)
m_bufferSize = m_packetSamples * m_sampleBytes;
if (m_byteBuffer) {
if (m_byteBuffer)
{
delete[] m_byteBuffer;
m_byteBuffer = nullptr;
}
m_byteBuffer = new uint8_t[m_bufferSize];