Ver a proveniência

[raudio] Fixed memory leak on early-return of WaveFormat func (#4779)

In the case of a failure within miniaudio on the function: ma_convert_frames, the dynamic memory allocated for the `data` variable  will leak on the early return.
pull/4787/head
Ralph Caraveo há 3 semanas
committed by GitHub
ascendente
cometimento
4522ecae1a
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: B5690EEEBB952194
1 ficheiros alterados com 1 adições e 0 eliminações
  1. +1
    -0
      src/raudio.c

+ 1
- 0
src/raudio.c Ver ficheiro

@ -1240,6 +1240,7 @@ void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels)
frameCount = (ma_uint32)ma_convert_frames(data, frameCount, formatOut, channels, sampleRate, wave->data, frameCountIn, formatIn, wave->channels, wave->sampleRate);
if (frameCount == 0)
{
RL_FREE(wave->data);
TRACELOG(LOG_WARNING, "WAVE: Failed format conversion");
return;
}

Carregando…
Cancelar
Guardar