Skip to content

Commit

Permalink
Cast values passed to FFMIN
Browse files Browse the repository at this point in the history
  • Loading branch information
scotts committed Jan 16, 2025
1 parent c228588 commit 07ef579
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/torchcodec/decoders/_core/FFMPEGCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ int AVIOBytesContext::read(void* opaque, uint8_t* buf, int buf_size) {
bufferData->current,
", size=",
bufferData->size);
buf_size = FFMIN(buf_size, bufferData->size - bufferData->current);
buf_size =
FFMIN(buf_size, static_cast<int>(bufferData->size - bufferData->current));
TORCH_CHECK(
buf_size >= 0,
"Tried to read negative bytes: buf_size=",
Expand Down

0 comments on commit 07ef579

Please sign in to comment.