archive/iso9660: implement seeking

This commit is contained in:
Max Kellermann 2019-05-31 18:40:24 +02:00
parent 17dd21ac7f
commit b2ae5298a7
2 changed files with 9 additions and 0 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ ver 0.21.26 (not yet released)
- bzip2: fix crash on corrupt bzip2 file
- bzip2: flush output at end of input file
- iso9660: fix unaligned reads
- iso9660: support seeking
- zzip: fix crash on corrupt ZIP file
* decoder
- sndfile: fix lost samples at end of file

View File

@ -198,12 +198,20 @@ public:
lsn(_lsn)
{
size = _size;
seekable = true;
SetReady();
}
/* virtual methods from InputStream */
bool IsEOF() noexcept override;
size_t Read(void *ptr, size_t size) override;
void Seek(offset_type new_offset) override {
if (new_offset > size)
throw std::runtime_error("Invalid seek offset");
offset = new_offset;
}
};
InputStreamPtr