Loading Kits/DirectXTK/Audio/AudioEngine.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1049,13 +1049,13 @@ void AudioEngine::Impl::AllocateVoice( const WAVEFORMATEX* wfx, SOUND_EFFECT_INS case WAVE_FORMAT_ADPCM: { auto wfadpcm = reinterpret_cast<const ADPCMWAVEFORMAT*>( wfx ); CreateADPCM( wfmt, 64, defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock ); CreateADPCM( wfmt, sizeof(buff), defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock ); } break; #if defined(_XBOX_ONE) && defined(_TITLE) case WAVE_FORMAT_XMA2: CreateXMA2( wfmt, 64, defaultRate, wfx->nChannels, 65536, 2, 0 ); CreateXMA2( wfmt, sizeof(buff), defaultRate, wfx->nChannels, 65536, 2, 0 ); break; #endif } Loading Kits/DirectXTK/Audio/SoundCommon.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -764,7 +764,7 @@ void SoundEffectInstanceBase::Apply3D( const AudioListener& listener, const Audi if ( reverb ) { for ( size_t j = 0; j < mDSPSettings.SrcChannelCount; ++j ) for ( size_t j = 0; (j < mDSPSettings.SrcChannelCount) && (j < XAUDIO2_MAX_AUDIO_CHANNELS); ++j ) { matrix[j] = mDSPSettings.ReverbLevel; } Loading Kits/DirectXTK/Audio/SoundEffectInstance.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -49,10 +49,10 @@ public: assert( engine != 0 ); engine->RegisterNotify( this, false ); char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); assert( mWaveBank != 0 ); mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, 64 ), flags ); mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, sizeof(buff) ), flags ); } virtual ~Impl() Loading Loading @@ -120,9 +120,9 @@ void SoundEffectInstance::Impl::Play( bool loop ) { if ( mWaveBank ) { char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, 64) ); mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, sizeof(buff) ) ); } else { Loading Loading @@ -195,8 +195,8 @@ void SoundEffectInstance::Impl::Play( bool loop ) #ifdef _DEBUG DebugTrace( "ERROR: SoundEffectInstance failed (%08X) when submitting buffer:\n", hr ); char buff[64]; auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), 64 ) char buff[64] = {}; auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), sizeof(buff) ) : mEffect->GetFormat(); size_t length = ( mWaveBank ) ? mWaveBank->GetSampleSizeInBytes( mIndex ) : mEffect->GetSampleSizeInBytes(); Loading Kits/DirectXTK/Audio/WaveBank.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ void WaveBank::Impl::Play( int index, float volume, float pitch, float pan ) mPrepared = true; } char wfxbuff[64]; char wfxbuff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( wfxbuff ); HRESULT hr = mReader.GetFormat( index, wfx, 64 ); HRESULT hr = mReader.GetFormat( index, wfx, sizeof(wfxbuff) ); ThrowIfFailed( hr ); IXAudio2SourceVoice* voice = nullptr; Loading Loading @@ -434,9 +434,9 @@ size_t WaveBank::GetSampleDurationMS( int index ) const if ( index < 0 || uint32_t(index) >= pImpl->mReader.Count() ) return 0; char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); HRESULT hr = pImpl->mReader.GetFormat( index, wfx, 64 ); HRESULT hr = pImpl->mReader.GetFormat( index, wfx, sizeof(buff) ); ThrowIfFailed( hr ); WaveBankReader::Metadata metadata; Loading Kits/DirectXTK/Audio/WaveBankReader.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -696,7 +696,7 @@ HRESULT WaveBankReader::Impl::Open( const wchar_t* szFileName ) DWORD n = m_data.dwEntryNameElementSize * j; char name[ 64 ] = {}; strncpy_s( name, &temp[ n ], 64 ); strncpy_s( name, &temp[ n ], sizeof(name) ); m_names[ name ] = j; } Loading Loading
Kits/DirectXTK/Audio/AudioEngine.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -1049,13 +1049,13 @@ void AudioEngine::Impl::AllocateVoice( const WAVEFORMATEX* wfx, SOUND_EFFECT_INS case WAVE_FORMAT_ADPCM: { auto wfadpcm = reinterpret_cast<const ADPCMWAVEFORMAT*>( wfx ); CreateADPCM( wfmt, 64, defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock ); CreateADPCM( wfmt, sizeof(buff), defaultRate, wfx->nChannels, wfadpcm->wSamplesPerBlock ); } break; #if defined(_XBOX_ONE) && defined(_TITLE) case WAVE_FORMAT_XMA2: CreateXMA2( wfmt, 64, defaultRate, wfx->nChannels, 65536, 2, 0 ); CreateXMA2( wfmt, sizeof(buff), defaultRate, wfx->nChannels, 65536, 2, 0 ); break; #endif } Loading
Kits/DirectXTK/Audio/SoundCommon.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -764,7 +764,7 @@ void SoundEffectInstanceBase::Apply3D( const AudioListener& listener, const Audi if ( reverb ) { for ( size_t j = 0; j < mDSPSettings.SrcChannelCount; ++j ) for ( size_t j = 0; (j < mDSPSettings.SrcChannelCount) && (j < XAUDIO2_MAX_AUDIO_CHANNELS); ++j ) { matrix[j] = mDSPSettings.ReverbLevel; } Loading
Kits/DirectXTK/Audio/SoundEffectInstance.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -49,10 +49,10 @@ public: assert( engine != 0 ); engine->RegisterNotify( this, false ); char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); assert( mWaveBank != 0 ); mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, 64 ), flags ); mBase.Initialize( engine, mWaveBank->GetFormat( index, wfx, sizeof(buff) ), flags ); } virtual ~Impl() Loading Loading @@ -120,9 +120,9 @@ void SoundEffectInstance::Impl::Play( bool loop ) { if ( mWaveBank ) { char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, 64) ); mBase.AllocateVoice( mWaveBank->GetFormat( mIndex, wfx, sizeof(buff) ) ); } else { Loading Loading @@ -195,8 +195,8 @@ void SoundEffectInstance::Impl::Play( bool loop ) #ifdef _DEBUG DebugTrace( "ERROR: SoundEffectInstance failed (%08X) when submitting buffer:\n", hr ); char buff[64]; auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), 64 ) char buff[64] = {}; auto wfx = ( mWaveBank ) ? mWaveBank->GetFormat( mIndex, reinterpret_cast<WAVEFORMATEX*>( buff ), sizeof(buff) ) : mEffect->GetFormat(); size_t length = ( mWaveBank ) ? mWaveBank->GetSampleSizeInBytes( mIndex ) : mEffect->GetSampleSizeInBytes(); Loading
Kits/DirectXTK/Audio/WaveBank.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ void WaveBank::Impl::Play( int index, float volume, float pitch, float pan ) mPrepared = true; } char wfxbuff[64]; char wfxbuff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( wfxbuff ); HRESULT hr = mReader.GetFormat( index, wfx, 64 ); HRESULT hr = mReader.GetFormat( index, wfx, sizeof(wfxbuff) ); ThrowIfFailed( hr ); IXAudio2SourceVoice* voice = nullptr; Loading Loading @@ -434,9 +434,9 @@ size_t WaveBank::GetSampleDurationMS( int index ) const if ( index < 0 || uint32_t(index) >= pImpl->mReader.Count() ) return 0; char buff[64]; char buff[64] = {}; auto wfx = reinterpret_cast<WAVEFORMATEX*>( buff ); HRESULT hr = pImpl->mReader.GetFormat( index, wfx, 64 ); HRESULT hr = pImpl->mReader.GetFormat( index, wfx, sizeof(buff) ); ThrowIfFailed( hr ); WaveBankReader::Metadata metadata; Loading
Kits/DirectXTK/Audio/WaveBankReader.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -696,7 +696,7 @@ HRESULT WaveBankReader::Impl::Open( const wchar_t* szFileName ) DWORD n = m_data.dwEntryNameElementSize * j; char name[ 64 ] = {}; strncpy_s( name, &temp[ n ], 64 ); strncpy_s( name, &temp[ n ], sizeof(name) ); m_names[ name ] = j; } Loading