Skip to content

Commit 419ac92

Browse files
committed
Ensure NaN cannot propagate through min/max weight selectors
1 parent 17c4025 commit 419ac92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/astcenc_weight_align.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// ----------------------------------------------------------------------------
3-
// Copyright 2011-2024 Arm Limited
3+
// Copyright 2011-2025 Arm Limited
44
//
55
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
66
// use this file except in compliance with the License. You may obtain a copy
@@ -183,8 +183,8 @@ static void compute_lowest_and_highest_weight(
183183
lane_id += vint(ASTCENC_SIMD_WIDTH);
184184

185185
vfloat weights = loada(dec_weight_ideal_value + i);
186-
min_weight = min(min_weight, select(min_weight, weights, active));
187-
max_weight = max(max_weight, select(max_weight, weights, active));
186+
min_weight = min(select(min_weight, weights, active), min_weight);
187+
max_weight = max(select(max_weight, weights, active), max_weight);
188188
}
189189

190190
min_weight = hmin(min_weight);

0 commit comments

Comments
 (0)