Commit c8e6f50d authored by Max Kellermann's avatar Max Kellermann

input/buffered: fix bogus offset after Seek()

Instead of copying the offset from our `input`, copy the requested offset to our `offset` attribute. By the time Seek() finishes, our input's offset may have advanced already, having read some more data, thus giving us a bogus offset. This fixes spurious decoder failues (closes #320).
parent 9263d6d0
......@@ -85,7 +85,7 @@ BufferedInputStream::Seek(offset_type new_offset)
if (seek_error)
std::rethrow_exception(std::exchange(seek_error, {}));
offset = input->GetOffset();
offset = new_offset;
}
bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment