From 4929d8775921c59f3f0cddf90481e7a4968e5ecc Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 20 Aug 2024 14:58:01 +0200 Subject: [PATCH] Fix uninitialized warning --- .../signal_source/libs/ion_gsms_chunk_unpacking_ctx.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/algorithms/signal_source/libs/ion_gsms_chunk_unpacking_ctx.h b/src/algorithms/signal_source/libs/ion_gsms_chunk_unpacking_ctx.h index 3c5d7b662..6799f1080 100644 --- a/src/algorithms/signal_source/libs/ion_gsms_chunk_unpacking_ctx.h +++ b/src/algorithms/signal_source/libs/ion_gsms_chunk_unpacking_ctx.h @@ -34,8 +34,8 @@ struct IONGSMSChunkUnpackingCtx static constexpr uint8_t word_bitsize_ = sizeof(WT) * 8; const GnssMetadata::Chunk::WordShift word_shift_direction_; - WT* iterator_; // Not owned by this class, MUST NOT destroy - WT current_word_; + WT* iterator_ = nullptr; // Not owned by this class, MUST NOT destroy + WT current_word_{}; uint8_t bitshift_ = 0; IONGSMSChunkUnpackingCtx( @@ -51,7 +51,10 @@ struct IONGSMSChunkUnpackingCtx { iterator_ = &data_buffer[data_buffer_word_count]; } - advance_word(); // Initializes current_word_ + if (iterator_) + { + advance_word(); // Initializes current_word_ + } } void advance_word()