File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -729,6 +729,9 @@ UniqueAVFrame BetaCudaDeviceInterface::transferCpuFrameToGpuNV12(
729729 convertedHeight == height, " sws_scale failed for CPU->NV12 conversion" );
730730
731731 int ySize = width * height;
732+ TORCH_CHECK (
733+ ySize % 2 == 0 ,
734+ " Y plane size must be even. Please report on TorchCodec repo." );
732735 int uvSize = ySize / 2 ; // NV12: UV plane is half the size of Y plane
733736 size_t totalSize = static_cast <size_t >(ySize + uvSize);
734737
@@ -767,6 +770,9 @@ UniqueAVFrame BetaCudaDeviceInterface::transferCpuFrameToGpuNV12(
767770 " Failed to copy Y plane to GPU: " ,
768771 cudaGetErrorString (err));
769772
773+ TORCH_CHECK (
774+ height % 2 == 0 ,
775+ " height must be even. Please report on TorchCodec repo." );
770776 err = cudaMemcpy2D (
771777 gpuFrame->data [1 ],
772778 gpuFrame->linesize [1 ],
You can’t perform that action at this time.
0 commit comments