Skip to content

Commit f892ad8

Browse files
committed
Clarify bilinear index int32 safety comments
1 parent b7cc2df commit f892ad8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

onnxruntime/core/providers/cpu/nn/deform_conv.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ ORT_FORCEINLINE void BilinearPlanOneSample(
285285
T plan_w10 = lh * hw;
286286
T plan_w11 = lh * lw;
287287

288+
// Safe under DeformConvValidateAndParse precondition: (H + 1) * W <= int_max.
289+
// With h_high <= H and w_high <= W, these linearized int indices stay in range.
290+
// Near borders h_low/w_low can be -1, but lower bounds also remain representable in int32.
288291
const int base_low = h_low * width;
289292
const int base_high = h_high * width;
290293
int32_t idx00 = base_low + w_low;

0 commit comments

Comments
 (0)