mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Handle WavpackUnpackSamples
failure
This commit is contained in:
parent
a8949cb96b
commit
82425f20d7
|
@ -533,7 +533,12 @@ int CSound::DecodeWV(int SampleID, const void *pData, unsigned DataSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
int *pBuffer = (int *)calloc((size_t)NumSamples * NumChannels, sizeof(int));
|
int *pBuffer = (int *)calloc((size_t)NumSamples * NumChannels, sizeof(int));
|
||||||
WavpackUnpackSamples(pContext, pBuffer, NumSamples); // TODO: check return value
|
if(!WavpackUnpackSamples(pContext, pBuffer, NumSamples))
|
||||||
|
{
|
||||||
|
free(pBuffer);
|
||||||
|
dbg_msg("sound/wv", "WavpackUnpackSamples failed. NumSamples=%d, NumChannels=%d", NumSamples, NumChannels);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
int *pSrc = pBuffer;
|
int *pSrc = pBuffer;
|
||||||
|
|
||||||
pSample->m_pData = (short *)calloc((size_t)NumSamples * NumChannels, sizeof(short));
|
pSample->m_pData = (short *)calloc((size_t)NumSamples * NumChannels, sizeof(short));
|
||||||
|
|
Loading…
Reference in a new issue