diff --git a/libavcodec/eval.c b/libavcodec/eval.c
index db15f2b5b3c008e32093c43afa823f6cd454483d..2aabb3bd6cb304249134408f8c65fee53b35442e 100644
--- a/libavcodec/eval.c
+++ b/libavcodec/eval.c
@@ -35,7 +35,7 @@
 #include <math.h>
 
 #ifndef NAN
-  #define NAN 0
+  #define NAN 0.0/0.0
 #endif
 
 #ifndef M_PI