"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "144e6e2540dd2cf5b0ba26438f4ff0da0ca2e659"
Unverified Commit 2cfc360e authored by Francisco Massa's avatar Francisco Massa Committed by GitHub
Browse files

Fix overflow error for large buffers. (#2303)



Summary:
Allow writes of >= 2^32 bytes. High-res video can cross this threshold sometimes.
LHS is `size_t`, but RHS is all `int32`, and will overflow for output tensors >2Gb.

Reviewed By: jsawruk

Differential Revision: D21255664

fbshipit-source-id: 7b4c5da989777297a89e73615aaeee8c7a13186a
Co-authored-by: default avatarTilak Sharma <tilaksharma@fb.com>
parent 3e06bc6f
...@@ -311,7 +311,7 @@ torch::List<torch::Tensor> readVideo( ...@@ -311,7 +311,7 @@ torch::List<torch::Tensor> readVideo(
videoFrame = torch::zeros( videoFrame = torch::zeros(
{numVideoFrames, outHeight, outWidth, numChannels}, torch::kByte); {numVideoFrames, outHeight, outWidth, numChannels}, torch::kByte);
expectedWrittenBytes = expectedWrittenBytes =
numVideoFrames * outHeight * outWidth * numChannels; (size_t)numVideoFrames * outHeight * outWidth * numChannels;
} }
videoFramePts = torch::zeros({numVideoFrames}, torch::kLong); videoFramePts = torch::zeros({numVideoFrames}, torch::kLong);
......
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