[prefast:Warning]: C26451 (#14628)

### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
JiCheng 2023-02-09 17:04:52 +08:00 committed by GitHub
parent b53038b6a0
commit c5b485d25f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -414,7 +414,8 @@ void ComputeInterpolationAtLevel2(int64_t num_channels, int64_t input_height, in
static_cast<double>(output_height * 2),
[&](std::ptrdiff_t first, std::ptrdiff_t last) {
if (output_height == input_height) {
std::copy_n(Xdata_span.begin() + narrow<size_t>(first * input_width), narrow<size_t>((last - first) * output_width),
auto workload_in_thread = narrow<size_t>(last) - narrow<size_t>(first);
std::copy_n(Xdata_span.begin() + narrow<size_t>(first * input_width), narrow<size_t>(workload_in_thread * output_width),
Ydata_span.begin() + narrow<size_t>(first * output_width));
return;
}