diff --git a/src/common/cd_image.cpp b/src/common/cd_image.cpp index 658d3b6d6..7af18bcfe 100644 --- a/src/common/cd_image.cpp +++ b/src/common/cd_image.cpp @@ -321,8 +321,22 @@ void CDImage::ClearTOC() void CDImage::CopyTOC(const CDImage* image) { m_lba_count = image->m_lba_count; - m_indices = image->m_indices; - m_tracks = image->m_tracks; + m_indices.clear(); + m_indices.reserve(image->m_indices.size()); + + // Damn bitfield copy constructor... + for (const Index& index : image->m_indices) + { + Index new_index; + std::memcpy(&new_index, &index, sizeof(new_index)); + m_indices.push_back(new_index); + } + for (const Track& track : image->m_tracks) + { + Track new_track; + std::memcpy(&new_track, &track, sizeof(new_track)); + m_tracks.push_back(new_track); + } m_current_index = nullptr; m_position_in_index = 0; m_position_in_track = 0; diff --git a/src/common/cd_image.h b/src/common/cd_image.h index d5fa87d02..116e8af77 100644 --- a/src/common/cd_image.h +++ b/src/common/cd_image.h @@ -135,8 +135,6 @@ public: BitField digital_copy_permitted; BitField data; BitField four_channel_audio; - - Control& operator=(const Control& c) { bits = c.bits; return *this; } }; struct