efi_loader: do not set invalid screen mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetMode() should return EFI_UNDEFINED if a screen mode is not available. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <agraf@csgraf.de>
This commit is contained in:
parent
97ea0690f4
commit
03446987c5
@ -379,6 +379,10 @@ static efi_status_t EFIAPI efi_cout_set_mode(
|
||||
|
||||
if (mode_number >= efi_con_mode.max_mode)
|
||||
return EFI_EXIT(EFI_UNSUPPORTED);
|
||||
|
||||
if (!efi_cout_modes[mode_number].present)
|
||||
return EFI_EXIT(EFI_UNSUPPORTED);
|
||||
|
||||
efi_con_mode.mode = mode_number;
|
||||
EFI_CALL(efi_cout_clear_screen(this));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user