diff --git a/configure b/configure
index 6d14d37fda23851933cadff366393dd1bdc6cec9..28ec5bf01e990c66e2cf17d38c7315973b5c9619 100755
--- a/configure
+++ b/configure
@@ -1820,6 +1820,7 @@ MATH_FUNCS="
     exp2f
     expf
     hypot
+    isfinite
     isinf
     isnan
     ldexpf
diff --git a/libavutil/libm.h b/libavutil/libm.h
index bc44dcab0fd406dc42b0c0f72e4978ba8d354c2d..a8199623912d50d3439cb11e59c0c9a7712d125d 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -343,6 +343,25 @@ static av_always_inline av_const int avpriv_isnan(double x)
         : avpriv_isnan(x))
 #endif /* HAVE_ISNAN */
 
+#if !HAVE_ISFINITE
+static av_always_inline av_const int avpriv_isfinitef(float x)
+{
+    uint32_t v = av_float2int(x);
+    return (v & 0x7f800000) != 0x7f800000;
+}
+
+static av_always_inline av_const int avpriv_isfinite(double x)
+{
+    uint64_t v = av_double2int(x);
+    return (v & 0x7ff0000000000000) != 0x7ff0000000000000;
+}
+
+#define isfinite(x)                  \
+    (sizeof(x) == sizeof(float)      \
+        ? avpriv_isfinitef(x)        \
+        : avpriv_isfinite(x))
+#endif /* HAVE_ISFINITE */
+
 #if !HAVE_HYPOT
 static inline av_const double hypot(double x, double y)
 {