diff --git a/ffprobe.c b/ffprobe.c
index 47dad44ec5cfc857f63164c5921e474c04699d6a..9a5951a6568632f70f4e5bd3840239c29b0b25c9 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -67,7 +67,7 @@ static char *value_string(char *buf, int buf_size, double val, const char *unit)
         int index;
 
         if (unit == unit_byte_str && use_byte_value_binary_prefix) {
-            index = (int) (log2(val)) / 10;
+            index = (int) (log(val)/log(2)) / 10;
             index = av_clip(index, 0, FF_ARRAY_ELEMS(binary_unit_prefixes) -1);
             val /= pow(2, index*10);
             prefix_string = binary_unit_prefixes[index];