mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
check for success when decoding audio
This commit is contained in:
parent
52217add6d
commit
1ccd357f53
|
@ -608,6 +608,8 @@ int CSound::LoadOpus(const char *pFilename)
|
|||
|
||||
SampleID = DecodeOpus(SampleID, pData, DataSize);
|
||||
free(pData);
|
||||
if(SampleID < 0)
|
||||
return -1;
|
||||
|
||||
if(g_Config.m_Debug)
|
||||
dbg_msg("sound/opus", "loaded %s", pFilename);
|
||||
|
@ -648,6 +650,8 @@ int CSound::LoadWV(const char *pFilename)
|
|||
|
||||
SampleID = DecodeWV(SampleID, pData, DataSize);
|
||||
free(pData);
|
||||
if(SampleID < 0)
|
||||
return -1;
|
||||
|
||||
if(g_Config.m_Debug)
|
||||
dbg_msg("sound/wv", "loaded %s", pFilename);
|
||||
|
@ -703,6 +707,8 @@ int CSound::LoadWVFromMem(const void *pData, unsigned DataSize, bool FromEditor
|
|||
return -1;
|
||||
|
||||
SampleID = DecodeWV(SampleID, pData, DataSize);
|
||||
if(SampleID < 0)
|
||||
return -1;
|
||||
|
||||
RateConvert(SampleID);
|
||||
return SampleID;
|
||||
|
|
Loading…
Reference in a new issue