Merge remote-tracking branch 'aosp/upstream-main' into liblc3

Change-Id: I789a0a7cab1ec3baec80f9d3eb348739f30cf446
diff --git a/METADATA b/METADATA
index ab29650..52e9577 100644
--- a/METADATA
+++ b/METADATA
@@ -12,6 +12,6 @@
     value: "https://github.com/google/liblc3"
   }
   version: "v1.1.1"
-  last_upgrade_date { year: 2024 month: 4 day: 26 }
+  last_upgrade_date { year: 2024 month: 6 day: 6 }
   license_type: NOTICE
 }
diff --git a/src/fastmath.h b/src/fastmath.h
index c61ae64..86cbdfa 100644
--- a/src/fastmath.h
+++ b/src/fastmath.h
@@ -20,6 +20,7 @@
 #define __LC3_FASTMATH_H
 
 #include <stdint.h>
+#include <float.h>
 #include <math.h>
 
 
diff --git a/src/sns.c b/src/sns.c
index 0b5aa14..85660d0 100644
--- a/src/sns.c
+++ b/src/sns.c
@@ -547,12 +547,12 @@
     /* --- Determe shape & gain index ---
      * Search the Mean Square Error, within (shape, gain) combinations */
 
-    float mse_min = INFINITY;
+    float mse_min = FLT_MAX;
     *shape_idx = *gain_idx = 0;
 
     for (int ic = 0; ic < 4; ic++) {
         const struct lc3_sns_vq_gains *cgains = lc3_sns_vq_gains + ic;
-        float cmse_min = INFINITY;
+        float cmse_min = FLT_MAX;
         int cgain_idx = 0;
 
         for (int ig = 0; ig < cgains->count; ig++) {