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).
This commit is contained in:
Max Kellermann 2018-07-25 00:01:39 +02:00
parent 9263d6d07d
commit c8e6f50d55

View File

@ -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