[FFmpeg-devel] [PATCH 1/2] avutil/libm: Replace macro based fminf() by function

Michael Niedermayer michaelni at gmx.at
Fri Jun 6 16:42:15 CEST 2014


This avoids issues when the FFMIN parameter evaluation has sideeffects

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/libm.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavutil/libm.h b/libavutil/libm.h
index eacb3cc..cb79728 100644
--- a/libavutil/libm.h
+++ b/libavutil/libm.h
@@ -84,7 +84,10 @@ static av_always_inline float cbrtf(float x)
 
 #if !HAVE_FMINF
 #undef fminf
-#define fminf(x, y) (FFMIN(x,y))
+static av_always_inline av_const float fminf(float x, float y)
+{
+    return FFMIN(x,y);
+}
 #endif
 
 #if !HAVE_ISINF
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list