From 733318bc2d484b5b214aa215bb54a1beab7fadb4 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 18 Nov 2019 10:42:51 +0100 Subject: Initialise AACDecoder::m_peak --- src/AACDecoder.cpp | 1 - src/AACDecoder.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/AACDecoder.cpp b/src/AACDecoder.cpp index 17fd96d..0df4fd6 100644 --- a/src/AACDecoder.cpp +++ b/src/AACDecoder.cpp @@ -29,7 +29,6 @@ AACDecoder::AACDecoder() if (not m_handle) { throw std::runtime_error("AACDecoder: error opening decoder"); } - } AACDecoder::~AACDecoder() diff --git a/src/AACDecoder.h b/src/AACDecoder.h index 6adae56..714e7a1 100644 --- a/src/AACDecoder.h +++ b/src/AACDecoder.h @@ -38,7 +38,7 @@ class AACDecoder { AACDecoder& operator=(const AACDecoder&) = delete; void decode_frame(uint8_t *data, size_t len); - struct peak_t { int16_t peak_left; int16_t peak_right; }; + struct peak_t { int16_t peak_left = 0; int16_t peak_right = 0; }; peak_t get_peaks(); private: @@ -46,7 +46,7 @@ class AACDecoder { bool m_decoder_set_up = false; int m_channels = 0; - peak_t m_peak; + peak_t m_peak = {}; HANDLE_AACDECODER m_handle; std::vector m_output_frame; -- cgit v1.2.3