From 425dee2f0b33e8b2df8f91f724a4bef16c40bc0b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 5 Nov 2021 15:19:21 +1000 Subject: [PATCH] CDImage: Fix tracks not getting brought across in CopyTOC() --- src/common/cd_image.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/cd_image.cpp b/src/common/cd_image.cpp index 5b2879aa8..1d384e815 100644 --- a/src/common/cd_image.cpp +++ b/src/common/cd_image.cpp @@ -338,8 +338,10 @@ void CDImage::ClearTOC() void CDImage::CopyTOC(const CDImage* image) { m_lba_count = image->m_lba_count; - m_indices.clear(); + decltype(m_indices)().swap(m_indices); + decltype(m_tracks)().swap(m_tracks); m_indices.reserve(image->m_indices.size()); + m_tracks.reserve(image->m_tracks.size()); // Damn bitfield copy constructor... for (const Index& index : image->m_indices)