fix: fix potential integer overflow in CommandListCoreFamily getInputBufferSize

Related-To: GSD-4137
Signed-off-by: Wenju He <wenju.he@intel.com>
This commit is contained in:
Wenju He
2024-03-28 03:44:17 +00:00
committed by Compute-Runtime-Automation
parent 489ef2a310
commit b0b82171ab

View File

@@ -2267,9 +2267,9 @@ inline uint64_t CommandListCoreFamily<gfxCoreFamily>::getInputBufferSize(NEO::Im
return bufferRowPitch;
case NEO::ImageType::image2D:
case NEO::ImageType::image2DArray:
return bufferRowPitch * region->height;
return static_cast<uint64_t>(bufferRowPitch) * region->height;
case NEO::ImageType::image3D:
return bufferSlicePitch * region->depth;
return static_cast<uint64_t>(bufferSlicePitch) * region->depth;
}
}