- initial work to fix RTPdump decoder + more fixes

This commit is contained in:
2026-02-24 09:50:44 +03:00
parent 783359c616
commit bdc4858bcc
13 changed files with 1080 additions and 420 deletions

View File

@@ -18,14 +18,24 @@ DataWindow::DataWindow()
DataWindow::~DataWindow()
{
if (mData)
{
free(mData);
mData = nullptr;
}
}
void DataWindow::setCapacity(int capacity)
{
Lock l(mMutex);
int tail = capacity - mCapacity;
char* buffer = mData;
mData = (char*)realloc(mData, capacity);
if (!mData)
{
// Realloc failed
mData = buffer;
throw std::bad_alloc();
}
if (tail > 0)
memset(mData + mCapacity, 0, tail);
mCapacity = capacity;