From 807a19889fe3489b89b8310a7ce34f434bdfa85c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Jul 2022 13:37:50 +0200 Subject: [PATCH] input/CdioParanoia: update offset only after successful seek If seeking fails, don't leave the class with a wrong offset. --- src/input/plugins/CdioParanoiaInputPlugin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/input/plugins/CdioParanoiaInputPlugin.cxx b/src/input/plugins/CdioParanoiaInputPlugin.cxx index ee4b82ff4..8784273b4 100644 --- a/src/input/plugins/CdioParanoiaInputPlugin.cxx +++ b/src/input/plugins/CdioParanoiaInputPlugin.cxx @@ -275,12 +275,13 @@ CdioParanoiaInputStream::Seek(std::unique_lock &, /* calculate current LSN */ const int32_t lsn_relofs = new_offset / CDIO_CD_FRAMESIZE_RAW; - offset = new_offset; { const ScopeUnlock unlock(mutex); para.Seek(lsn_from + lsn_relofs); } + + offset = new_offset; } size_t