Skip to content

Commit 98a1efb

Browse files
committed
o Add minor bounds check for calc wts fn
1 parent 9dec036 commit 98a1efb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

uxarray/remap/bilinear.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ def _calculate_weights(
162162
):
163163
for idx in prange(len(valid_idxs)):
164164
fidx = int(face_indices[valid_idxs[idx], 0])
165+
# bounds check
166+
if fidx < 0 or fidx >= len(n_nodes_per_face):
167+
continue
165168
nverts = int(n_nodes_per_face[fidx])
166-
167169
polygon_xyz = np.zeros((nverts, 3), dtype=np.float64)
168170
polygon_face_indices = np.empty(nverts, dtype=np.int32)
169171
for j in range(nverts):

0 commit comments

Comments
 (0)