mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-06-08 00:23:52 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user