From cf366d3fbabcb34f18469a7c9344307f2b4eff41 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 22 Jul 2020 00:02:51 +1000 Subject: [PATCH] CDImage: Fix crash reading subq from lead-in --- src/common/cd_image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/cd_image.cpp b/src/common/cd_image.cpp index c759bb813..1f682875c 100644 --- a/src/common/cd_image.cpp +++ b/src/common/cd_image.cpp @@ -229,7 +229,7 @@ bool CDImage::ReadRawSector(void* buffer) bool CDImage::ReadSubChannelQ(SubChannelQ* subq) { // handle case where we're at the end of the track/index - if (m_position_in_index == m_current_index->length) + if (!m_current_index || m_position_in_index == m_current_index->length) return GenerateSubChannelQ(subq, m_position_on_disc); // otherwise save the index lookup