By default, if one uses the BSP_LCD_Init() function provided by the library "stm32469i_discovery_lcd.h" to set up the LCD screen of an STM32469I-Discovery board, the screen orientation will be landscape. If one wants to change it to portrait instead, he or she will have to use BSP_LCD_InitEx(LCD_ORIENTATION_PORTRAIT) but unfortunately that does not work and all you will get is a blank screen because there is a bug in said function.
As it turns out, some settings within the function were mixed up. The following is the corrected version which fixes everything and finally gives users the ability to switch to a portrait orientation. The problem can be found beginning from line 252 of the source code "stm32469i_discovery_lcd.c".
P.S. Tested with STM32CubeF4 v.1.11.0