rocr: Prevent int overflow in arithmetic operation

Cast range->x and range->y to uint64_t before performing multiplication

Signed-off-by: Alysa Liu <Alysa.Liu@amd.com>
Cette révision appartient à :
Alysa Liu
2025-06-09 09:40:14 -04:00
révisé par Liu, Alysa
Parent df5d66eae5
révision 77b86ca908
+1 -1
Voir le fichier
@@ -646,7 +646,7 @@ BlitSdma<RingIndexTy, HwIndexMonotonic, SizeToCountOffset, useGCR>::SubmitCopyRe
BuildCopyRectCommand(append, dst, dst_offset, src, src_offset, range); BuildCopyRectCommand(append, dst, dst_offset, src, src_offset, range);
} }
uint64_t size = range->x * range->y * range->z; uint64_t size = static_cast<uint64_t>(range->x) * static_cast<uint64_t>(range->y) * range->z;
std::vector<core::Signal*> gang_signals(0); std::vector<core::Signal*> gang_signals(0);