6796: CSound: Initialize all members (fixes #6795) r=Robyt3 a=def-

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2023-07-02 09:23:09 +00:00 committed by GitHub
commit c955905662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -275,6 +275,11 @@ static void SdlCallback(void *pUnused, Uint8 *pStream, int Len)
#endif
}
CSound::CSound() :
m_SoundEnabled(false), m_Device(0), m_pGraphics(nullptr), m_pStorage(nullptr)
{
}
int CSound::Init()
{
m_SoundEnabled = false;

View file

@ -28,6 +28,7 @@ class CSound : public IEngineSound
static int DecodeOpus(int SampleID, const void *pData, unsigned DataSize);
public:
CSound();
int Init() override;
int Update() override;
void Shutdown() override;