mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-08 21:33:57 +00:00
[client] audio: check for malloc failure
This commit is contained in:
parent
016001da67
commit
a7db3d3a0f
1 changed files with 12 additions and 0 deletions
|
@ -421,10 +421,22 @@ void audio_playbackData(uint8_t * data, size_t size)
|
|||
}
|
||||
spiceData->periodFrames = frames;
|
||||
spiceData->framesIn = malloc(frames * audio.playback.stride);
|
||||
if (!spiceData->framesIn)
|
||||
{
|
||||
DEBUG_ERROR("Failed to malloc framesIn");
|
||||
playbackStopNL();
|
||||
return;
|
||||
}
|
||||
|
||||
spiceData->framesOutSize = round(frames * 1.1);
|
||||
spiceData->framesOut =
|
||||
malloc(spiceData->framesOutSize * audio.playback.stride);
|
||||
if (!spiceData->framesOut)
|
||||
{
|
||||
DEBUG_ERROR("Failed to malloc framesOut");
|
||||
playbackStopNL();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
src_short_to_float_array((int16_t *) data, spiceData->framesIn,
|
||||
|
|
Loading…
Reference in a new issue