Skip to content

Commit 67f5fcf

Browse files
For std::min and std::max cast to like data types (#2389)
Signed-off-by: Jeff Kriske <[email protected]>
1 parent 75f5b57 commit 67f5fcf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

torchvision/csrc/cpu/decoder/seekable_buffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool SeekableBuffer::readBytes(
5555
size_t maxBytes,
5656
uint64_t timeoutMs) {
5757
// Resize to th minimum 4K page or less
58-
buffer_.resize(std::min(maxBytes, 4 * 1024UL));
58+
buffer_.resize(std::min(maxBytes, size_t(4 * 1024UL)));
5959
end_ = 0;
6060
eof_ = false;
6161

@@ -72,7 +72,7 @@ bool SeekableBuffer::readBytes(
7272
if (res > 0) {
7373
end_ += res;
7474
if (end_ == buffer_.size()) {
75-
buffer_.resize(std::min(end_ * 4UL, maxBytes));
75+
buffer_.resize(std::min(size_t(end_ * 4UL), maxBytes));
7676
}
7777
} else if (res == 0) {
7878
eof_ = true;

torchvision/csrc/cpu/decoder/util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ void setFormatDimensions(
395395
}
396396
}
397397
// prevent zeros
398-
destW = std::max(destW, 1UL);
399-
destH = std::max(destH, 1UL);
398+
destW = std::max(destW, size_t(1UL));
399+
destH = std::max(destH, size_t(1UL));
400400
}
401401
} // namespace Util
402402
} // namespace ffmpeg

0 commit comments

Comments
 (0)