From 7f63ad8707d572b5a6b487e07e91a0b690b34a54 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 8 Feb 2020 10:25:08 +0100 Subject: [PATCH] - fixed uninitialized variables in decoders. --- source/decoder/mpg123_decoder.h | 7 +++---- source/decoder/sndfile_decoder.h | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/decoder/mpg123_decoder.h b/source/decoder/mpg123_decoder.h index f7de06a..4f6e955 100644 --- a/source/decoder/mpg123_decoder.h +++ b/source/decoder/mpg123_decoder.h @@ -25,17 +25,16 @@ struct MPG123Decoder : public SoundDecoder virtual size_t getSampleOffset() override; virtual size_t getSampleLength() override; - MPG123Decoder() : MPG123(0) { } virtual ~MPG123Decoder(); protected: virtual bool open(MusicIO::FileInterface *reader) override; private: - mpg123_handle *MPG123; - bool Done; + mpg123_handle *MPG123 = nullptr; + bool Done = false; + MusicIO::FileInterface* Reader = nullptr; - MusicIO::FileInterface* Reader; static off_t file_lseek(void *handle, off_t offset, int whence); static ssize_t file_read(void *handle, void *buffer, size_t bytes); diff --git a/source/decoder/sndfile_decoder.h b/source/decoder/sndfile_decoder.h index cb091a8..af182f4 100644 --- a/source/decoder/sndfile_decoder.h +++ b/source/decoder/sndfile_decoder.h @@ -21,17 +21,16 @@ struct SndFileDecoder : public SoundDecoder virtual size_t getSampleOffset() override; virtual size_t getSampleLength() override; - SndFileDecoder() : SndFile(0) { } virtual ~SndFileDecoder(); protected: virtual bool open(MusicIO::FileInterface *reader) override; private: - SNDFILE *SndFile; + SNDFILE *SndFile = nullptr; SF_INFO SndInfo; + MusicIO::FileInterface* Reader = nullptr; - MusicIO::FileInterface* Reader; static sf_count_t file_get_filelen(void *user_data); static sf_count_t file_seek(sf_count_t offset, int whence, void *user_data); static sf_count_t file_read(void *ptr, sf_count_t count, void *user_data);