From 68fd77c326be918594ef27082b236a932b926bbb Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 13 May 2021 03:20:39 +1000 Subject: [PATCH] CDImagePBP: Fix reading from track 1 pregap --- src/common/cd_image_pbp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/cd_image_pbp.cpp b/src/common/cd_image_pbp.cpp index 0fc083494..88bbeabe4 100644 --- a/src/common/cd_image_pbp.cpp +++ b/src/common/cd_image_pbp.cpp @@ -570,8 +570,8 @@ bool CDImagePBP::OpenDisc(u32 index, Common::Error* error) SubChannelQ::Control track_control = {}; track_control.data = !is_audio_track; - const LBA pregap_start = Position::FromBCD(t.pregap_start.m, t.pregap_start.s, t.pregap_start.f).ToLBA(); - const LBA userdata_start = Position::FromBCD(t.userdata_start.m, t.userdata_start.s, t.userdata_start.f).ToLBA(); + LBA pregap_start = Position::FromBCD(t.pregap_start.m, t.pregap_start.s, t.pregap_start.f).ToLBA(); + LBA userdata_start = Position::FromBCD(t.userdata_start.m, t.userdata_start.s, t.userdata_start.f).ToLBA(); LBA pregap_frames; u32 pregap_sector_size; @@ -587,6 +587,7 @@ bool CDImagePBP::OpenDisc(u32 index, Common::Error* error) Log_WarningPrintf( "Invalid TOC entry at index %u, user data (%u) should not start before pregap (%u), assuming not in file.", static_cast(curr_track), userdata_start, pregap_start); + pregap_start = 0; pregap_frames = userdata_start; pregap_sector_size = 0; }