From 112a46f80aabeb1198f1843bc98a931bf245a206 Mon Sep 17 00:00:00 2001 From: JiCheng Date: Thu, 9 Feb 2023 17:04:52 +0800 Subject: [PATCH] [prefast:Warning]: C26451 (#14628) ### Description ### Motivation and Context --- onnxruntime/core/providers/cpu/tensor/upsample_antialias.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h b/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h index e5e641e96f7af..59b512def619d 100644 --- a/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h +++ b/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h @@ -414,7 +414,8 @@ void ComputeInterpolationAtLevel2(int64_t num_channels, int64_t input_height, in static_cast(output_height * 2), [&](std::ptrdiff_t first, std::ptrdiff_t last) { if (output_height == input_height) { - std::copy_n(Xdata_span.begin() + narrow(first * input_width), narrow((last - first) * output_width), + auto workload_in_thread = narrow(last) - narrow(first); + std::copy_n(Xdata_span.begin() + narrow(first * input_width), narrow(workload_in_thread * output_width), Ydata_span.begin() + narrow(first * output_width)); return; }