Browse Source

Update raudio.c

pull/3709/head
Ray 1 year ago
parent
commit
c95b71d40d
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/raudio.c

+ 4
- 2
src/raudio.c View File

@ -939,12 +939,14 @@ Sound LoadSoundAlias(Sound source)
if (source.stream.buffer->data != NULL) if (source.stream.buffer->data != NULL)
{ {
AudioBuffer* audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC); AudioBuffer *audioBuffer = LoadAudioBuffer(AUDIO_DEVICE_FORMAT, AUDIO_DEVICE_CHANNELS, AUDIO.System.device.sampleRate, 0, AUDIO_BUFFER_USAGE_STATIC);
if (audioBuffer == NULL) if (audioBuffer == NULL)
{ {
TRACELOG(LOG_WARNING, "SOUND: Failed to create buffer"); 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->sizeInFrames = source.stream.buffer->sizeInFrames;
audioBuffer->volume = source.stream.buffer->volume; audioBuffer->volume = source.stream.buffer->volume;
audioBuffer->data = source.stream.buffer->data; audioBuffer->data = source.stream.buffer->data;

||||||
x
 
000:0
Loading…
Cancel
Save