mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 21:43:40 +00:00
[client] audio: check for malloc failure
This commit is contained in:
parent
016001da67
commit
a7db3d3a0f
@ -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 New Issue
Block a user