input/rewind, archive/iso9660: use use std::cmp_*() for safe integer comparison
This commit is contained in:
parent
b0cfdfa257
commit
d685d693e8
@ -242,7 +242,7 @@ Iso9660InputStream::Read(std::unique_lock<Mutex> &,
|
||||
if (remaining == 0)
|
||||
return 0;
|
||||
|
||||
if (offset_type(read_size) > remaining)
|
||||
if (std::cmp_greater(read_size, remaining))
|
||||
read_size = remaining;
|
||||
|
||||
auto r = buffer.Read();
|
||||
|
@ -105,7 +105,7 @@ RewindInputStream::Seek(std::unique_lock<Mutex> &lock, offset_type new_offset)
|
||||
{
|
||||
assert(IsReady());
|
||||
|
||||
if (tail > 0 && new_offset <= (offset_type)tail) {
|
||||
if (tail > 0 && std::cmp_less_equal(new_offset, tail)) {
|
||||
/* buffered seek */
|
||||
|
||||
assert(!ReadingFromBuffer() ||
|
||||
|
Loading…
Reference in New Issue
Block a user