aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alBuffer.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-08-31 04:56:10 -0700
committerChris Robinson <[email protected]>2016-08-31 04:56:10 -0700
commitccf90df07215b4317e2842641a8915d757868e8b (patch)
treea7ae4c7f4c1357bb9fb14fad901872cf2c3e202d /OpenAL32/alBuffer.c
parentf791b8c517732adf3dfc50b5b6086400b720960b (diff)
Initialize some enums to dummy values
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r--OpenAL32/alBuffer.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index c52924a9..f9093cb7 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -139,8 +139,8 @@ AL_API ALboolean AL_APIENTRY alIsBuffer(ALuint buffer)
AL_API ALvoid AL_APIENTRY alBufferData(ALuint buffer, ALenum format, const ALvoid *data, ALsizei size, ALsizei freq)
{
- enum UserFmtChannels srcchannels;
- enum UserFmtType srctype;
+ enum UserFmtChannels srcchannels = UserFmtMono;
+ enum UserFmtType srctype = UserFmtByte;
ALCdevice *device;
ALCcontext *context;
ALbuffer *albuf;
@@ -288,8 +288,8 @@ done:
AL_API ALvoid AL_APIENTRY alBufferSubDataSOFT(ALuint buffer, ALenum format, const ALvoid *data, ALsizei offset, ALsizei length)
{
- enum UserFmtChannels srcchannels;
- enum UserFmtType srctype;
+ enum UserFmtChannels srcchannels = UserFmtMono;
+ enum UserFmtType srctype = UserFmtByte;
ALCdevice *device;
ALCcontext *context;
ALbuffer *albuf;
@@ -981,13 +981,14 @@ done:
*/
ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei frames, enum UserFmtChannels SrcChannels, enum UserFmtType SrcType, const ALvoid *data, ALsizei align, ALboolean storesrc)
{
+ enum FmtChannels DstChannels = FmtMono;
+ enum FmtType DstType = FmtByte;
ALuint NewChannels, NewBytes;
- enum FmtChannels DstChannels;
- enum FmtType DstType;
ALuint64 newsize;
- if(DecomposeFormat(NewFormat, &DstChannels, &DstType) == AL_FALSE ||
- (long)SrcChannels != (long)DstChannels)
+ if(DecomposeFormat(NewFormat, &DstChannels, &DstType) == AL_FALSE)
+ return AL_INVALID_ENUM;
+ if((long)SrcChannels != (long)DstChannels)
return AL_INVALID_ENUM;
NewChannels = ChannelsFromFmt(DstChannels);