Commit 3b05c897 authored by Max Kellermann's avatar Max Kellermann

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
parent e77b3fa4
......@@ -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 {
......
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