From 9148b8f19e638c15cca22350194ade9985151c5f Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 8 Jan 2020 01:52:16 +0000 Subject: [PATCH] Fix infinite loop in pregap calculation when subchannel comes empty. --- DiscImageChef.Core/Devices/Dumping/CompactDisc/Pregap.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Pregap.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Pregap.cs index 2b2d871ba..778a27bea 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc/Pregap.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc/Pregap.cs @@ -250,6 +250,13 @@ namespace DiscImageChef.Core.Devices.Dumping updateStatus?.Invoke($"Could not get correct subchannel for sector {lba}"); } + if(subBuf.All(b => b == 0)) + { + inexactPositioning = true; + + break; + } + BcdToBinaryQ(subBuf); // If it's not Q position