Fix bug in CHECK_ORDER_IS_VALID macro (#694)

Fixes https://github.com/xiph/flac/issues/635
This commit is contained in:
Martijn van Beurden 2024-04-30 15:30:30 +02:00 committed by GitHub
parent 49ab34dfef
commit 61f8513c1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -357,7 +357,7 @@ uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint3
if(order_##macro_order##_is_valid && total_error_##macro_order < smallest_error) { \
order = macro_order; \
smallest_error = total_error_##macro_order ; \
residual_bits_per_sample[ macro_order ] = (float)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0); \
residual_bits_per_sample[ macro_order ] = (float)((total_error_##macro_order > 0) ? log(M_LN2 * (double)total_error_##macro_order / (double)data_len) / M_LN2 : 0.0); \
} \
else \
residual_bits_per_sample[ macro_order ] = 34.0f;