archive/iso9660: fix off-by-one assertion failure
Calling data[fill] could trigger an assertion failure if fill==data.size(), even if we call it only to take the address. Instead of doing that, this commit changes the code to pointer arithmetic. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1556
This commit is contained in:
parent
e77b3fa46f
commit
3b05c89765
@ -166,7 +166,7 @@ class Iso9660InputStream final : public InputStream {
|
||||
assert(fill <= data.size());
|
||||
assert(position <= fill);
|
||||
|
||||
return {&data[position], &data[fill]};
|
||||
return {data.data() + position, data.data() + fill};
|
||||
}
|
||||
|
||||
void Consume(size_t nbytes) noexcept {
|
||||
|
Loading…
Reference in New Issue
Block a user