mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
Clear the wave format so the channel map is cleared before returning from SDL_LoadWAV_IO()
This commit is contained in:
@@ -2080,6 +2080,16 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin
|
|||||||
int result = -1;
|
int result = -1;
|
||||||
WaveFile file;
|
WaveFile file;
|
||||||
|
|
||||||
|
if (spec) {
|
||||||
|
SDL_zerop(spec);
|
||||||
|
}
|
||||||
|
if (audio_buf) {
|
||||||
|
*audio_buf = NULL;
|
||||||
|
}
|
||||||
|
if (audio_len) {
|
||||||
|
*audio_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make sure we are passed a valid data source */
|
/* Make sure we are passed a valid data source */
|
||||||
if (!src) {
|
if (!src) {
|
||||||
goto done; /* Error may come from SDL_IOStream. */
|
goto done; /* Error may come from SDL_IOStream. */
|
||||||
@@ -2094,9 +2104,6 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
*audio_buf = NULL;
|
|
||||||
*audio_len = 0;
|
|
||||||
|
|
||||||
SDL_zero(file);
|
SDL_zero(file);
|
||||||
file.riffhint = WaveGetRiffSizeHint();
|
file.riffhint = WaveGetRiffSizeHint();
|
||||||
file.trunchint = WaveGetTruncationHint();
|
file.trunchint = WaveGetTruncationHint();
|
||||||
|
Reference in New Issue
Block a user