input/CdioParanoia: update offset only after successful seek

If seeking fails, don't leave the class with a wrong offset.
This commit is contained in:
Max Kellermann 2022-07-08 13:37:50 +02:00
parent df7242de91
commit 807a19889f

View File

@ -275,12 +275,13 @@ CdioParanoiaInputStream::Seek(std::unique_lock<Mutex> &,
/* 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