mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-15 01:56:40 +02:00
Use realloc to avoid memleak
This commit is contained in:
parent
6d4b91cf2b
commit
549fcba40f
2 changed files with 2 additions and 2 deletions
|
@ -146,7 +146,7 @@ void OpusEncoder::initEncoder()
|
|||
|
||||
// create some opus pseudo header to let the decoder know about the sample format
|
||||
headerChunk_->payloadSize = 12;
|
||||
headerChunk_->payload = (char*)malloc(headerChunk_->payloadSize);
|
||||
headerChunk_->payload = (char*)realloc(headerChunk_->payload, headerChunk_->payloadSize);
|
||||
char* payload = headerChunk_->payload;
|
||||
assign(payload, SWAP_32(ID_OPUS));
|
||||
assign(payload + 4, SWAP_32(sampleFormat_.rate));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue