diff --git a/src/FluxDecoder.cpp b/src/FluxDecoder.cpp index 051ab01..6f0b92f 100644 --- a/src/FluxDecoder.cpp +++ b/src/FluxDecoder.cpp @@ -13,7 +13,6 @@ FluxDecoder::FluxDecoder (const FluxData &flux_revs, int bitcell_ns, int flux_sc m_pll_adjust(pll_adjust) { assert(flux_revs.size()); - assert(flux_revs[0].size()); m_rev_it = m_flux_revs.cbegin(); m_flux_it = (*m_rev_it).cbegin(); @@ -111,6 +110,8 @@ int FluxDecoder::next_flux () m_index = true; m_flux_it = (*m_rev_it).cbegin(); + if (m_flux_it == (*m_rev_it).cend()) + return -1; } auto time_ns = *m_flux_it++; diff --git a/src/Sector.cpp b/src/Sector.cpp index a46c15b..8ed2534 100644 --- a/src/Sector.cpp +++ b/src/Sector.cpp @@ -82,7 +82,7 @@ Sector::Merge Sector::add (Data &&new_data, bool bad_crc, uint8_t new_dam) CRC16 crc; if (encoding == Encoding::MFM) crc.init(CRC16::A1A1A1); crc.add(new_dam); - auto bad_data_crc = crc.add(new_data.new_data(), size() + 2) != 0; + auto bad_data_crc = crc.add(new_data.data(), size() + 2) != 0; assert(bad_crc == bad_data_crc); } #endif