mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +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->periodFrames = frames;
|
||||||
spiceData->framesIn = malloc(frames * audio.playback.stride);
|
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->framesOutSize = round(frames * 1.1);
|
||||||
spiceData->framesOut =
|
spiceData->framesOut =
|
||||||
malloc(spiceData->framesOutSize * audio.playback.stride);
|
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,
|
src_short_to_float_array((int16_t *) data, spiceData->framesIn,
|
||||||
|
Loading…
Reference in New Issue
Block a user