Fix potential malloc(0) issue
This commit is contained in:
parent
a0f05e6dda
commit
c75b2355c1
@ -80,7 +80,9 @@ AlsaAudioSlave::AlsaAudioSlave (
|
||||
_play_buff = (float*) malloc (sizeof(float) * _pcmi.nplay () * _samples_per_period);
|
||||
}
|
||||
|
||||
_src_buff = (float*) malloc (sizeof(float) * std::max (_pcmi.nplay (), _pcmi.ncapt ()));
|
||||
if (_pcmi.nplay () > 0 || _pcmi.ncapt () > 0) {
|
||||
_src_buff = (float*) malloc (sizeof(float) * std::max (_pcmi.nplay (), _pcmi.ncapt ()));
|
||||
}
|
||||
}
|
||||
|
||||
AlsaAudioSlave::~AlsaAudioSlave ()
|
||||
|
Loading…
Reference in New Issue
Block a user