Even though the comment in system_stm32f4xx.c says "HSE Frequency 8000000", you either need to make sure that the relevant #define of HSE_VALUE is also set to 8000000, e.g. by changing it in stm32f4xx.h or define it within your toolchain:
from "stm43f4xx.h", lines 83ff:
/**
* @brief In the following line adjust the value of External High Speed oscillator (HSE)
used in your application
Tip: To avoid modifying this file each time you need to use different HSE, you
can define the HSE value in your toolchain compiler preprocessor.
*/
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */