Fixing 2 issues found via artificial encoder fuzzing, impacting the ASTC HDR 6x6/UASTC HDR 6x6i codec:

- 3 subset CEM 7/11 partition compression needs to check for rare failures
- adding clamp to bc6h encoder's smooth block weight index assigner (assign_weights_simple_4)
This commit is contained in:
Richard Geldreich
2026-03-06 17:20:37 -05:00
parent 6d9c1c2ed1
commit c606cef87c
2 changed files with 14 additions and 3 deletions

View File

@@ -23260,7 +23260,7 @@ namespace basist
const float r = fast_half_to_float_pos_not_inf_or_nan(pPixels[i * 3 + 0]);
const float g = fast_half_to_float_pos_not_inf_or_nan(pPixels[i * 3 + 1]);
const float b = fast_half_to_float_pos_not_inf_or_nan(pPixels[i * 3 + 2]);
const float w = ftoh(r * fdir_r + g * fdir_g + b * fdir_b);
const float w = ftoh(basisu::minimumf(r * fdir_r + g * fdir_g + b * fdir_b, basist::MAX_HALF_FLOAT));
pWeights[i] = (uint8_t)basisu::clamp((int)(w * frr + lr), 0, 15);
}