mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Ensure sampleBuffer is valid before trying to copy data (#151).
This commit is contained in:
parent
c463732f56
commit
e38e8d2ea7
@ -216,7 +216,7 @@ bool M4aDecoder::GetBuffer(IBuffer* target) {
|
||||
|
||||
free(encodedData);
|
||||
|
||||
if (frameInfo.error <= 0 && decoderSampleId <= this->totalSamples) {
|
||||
if (sampleBuffer && frameInfo.error <= 0 && decoderSampleId <= this->totalSamples) {
|
||||
target->SetSampleRate(frameInfo.samplerate);
|
||||
target->SetChannels(frameInfo.channels);
|
||||
target->SetSamples(frameInfo.samples);
|
||||
|
Loading…
Reference in New Issue
Block a user