1
0
Fork 0

Codefix: do not dereference the std::end() iterator

pull/13791/head
Rubidium 2025-03-09 22:37:53 +01:00 committed by rubidium42
parent afe66c7df4
commit 2926dd2c2f
1 changed files with 2 additions and 2 deletions

View File

@ -679,7 +679,7 @@ static std::vector<char> Gunzip(std::span<char> input)
* inflate is out of output space - allocate more */
z.avail_out += BLOCKSIZE;
output.resize(output.size() + BLOCKSIZE);
z.next_out = reinterpret_cast<Bytef *>(&*output.end() - z.avail_out);
z.next_out = reinterpret_cast<Bytef *>(output.data() + output.size() - z.avail_out);
res = inflate(&z, Z_FINISH);
}
@ -717,7 +717,7 @@ static std::vector<char> Xunzip(std::span<char> input)
* inflate is out of output space - allocate more */
z.avail_out += BLOCKSIZE;
output.resize(output.size() + BLOCKSIZE);
z.next_out = reinterpret_cast<uint8_t *>(&*output.end() - z.avail_out);
z.next_out = reinterpret_cast<uint8_t *>(output.data() + output.size() - z.avail_out);
res = lzma_code(&z, LZMA_FINISH);
}