mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-06-12 04:35:42 +00:00
SDL_CreateAudioStream: check for invalid parameters
This commit is contained in:
parent
01a4cf8a10
commit
c638b4a682
|
@ -1011,6 +1011,16 @@ SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
||||||
Uint8 pre_resample_channels;
|
Uint8 pre_resample_channels;
|
||||||
SDL_AudioStream *retval;
|
SDL_AudioStream *retval;
|
||||||
|
|
||||||
|
if (src_channels == 0) {
|
||||||
|
SDL_InvalidParamError("src_channels");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dst_channels == 0) {
|
||||||
|
SDL_InvalidParamError("dst_channels");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
retval = (SDL_AudioStream *)SDL_calloc(1, sizeof(SDL_AudioStream));
|
retval = (SDL_AudioStream *)SDL_calloc(1, sizeof(SDL_AudioStream));
|
||||||
if (retval == NULL) {
|
if (retval == NULL) {
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
|
|
Loading…
Reference in a new issue