Update raudio.c

This commit is contained in:
Ray 2024-01-05 22:33:02 +01:00
parent 3afb4dda97
commit c95b71d40d

View file

@ -940,11 +940,13 @@ Sound LoadSoundAlias(Sound source)
if (source.stream.buffer->data != NULL)
{
AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC);
if (audioBuffer == NULL)
{
TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer");
return sound; // early return to avoid dereferencing the audioBuffer null pointer
return sound; // Early return to avoid dereferencing the audioBuffer null pointer
}
audioBuffer->sizeInFrames = source.stream.buffer->sizeInFrames;
audioBuffer->volume = source.stream.buffer->volume;
audioBuffer->data = source.stream.buffer->data;