aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavutil/libm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/libm.h b/libavutil/libm.h
index 13e6cfe181..28d5df871b 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -86,7 +86,9 @@ static av_always_inline float cbrtf(float x)
#undef fminf
static av_always_inline av_const float fminf(float x, float y)
{
- return FFMIN(x, y);
+ //Note, the NaN special case is needed for C spec compliance, it should be
+ //optimized away if the users compiler is configured to assume no NaN
+ return x > y ? y : (x == x ? x : y);
}
#endif