mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-12 00:26:41 +02:00
Fix crash when feeding invalid ranges into flac
This commit is contained in:
parent
1725cffc6e
commit
5d7aedeb31
5 changed files with 38 additions and 12 deletions
|
@ -17,6 +17,7 @@
|
|||
***/
|
||||
|
||||
#include "pcm_encoder.hpp"
|
||||
#include "common/aixlog.hpp"
|
||||
#include "common/endian.hpp"
|
||||
#include <memory>
|
||||
|
||||
|
@ -29,6 +30,7 @@ static constexpr auto ID_WAVE = 0x45564157;
|
|||
static constexpr auto ID_FMT = 0x20746d66;
|
||||
static constexpr auto ID_DATA = 0x61746164;
|
||||
|
||||
static constexpr auto LOG_TAG = "PcmEnc";
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@ -57,6 +59,7 @@ void PcmEncoder::encode(const msg::PcmChunk& chunk)
|
|||
|
||||
void PcmEncoder::initEncoder()
|
||||
{
|
||||
LOG(INFO, LOG_TAG) << "Init\n";
|
||||
headerChunk_->payloadSize = 44;
|
||||
headerChunk_->payload = static_cast<char*>(realloc(headerChunk_->payload, headerChunk_->payloadSize));
|
||||
char* payload = headerChunk_->payload;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue