lfbvideo: Ensure we map enough space for large preset video modes

This commit is contained in:
K. Lange 2021-06-13 15:58:20 +09:00
parent 2eb83c5ecd
commit 914dc15f02

View File

@ -342,6 +342,11 @@ static void graphics_install_preset(uint16_t w, uint16_t h) {
lfb_resolution_y = mboot_struct->framebuffer_height;
lfb_resolution_s = mboot_struct->framebuffer_pitch;
lfb_resolution_b = 32;
/* Make sure memsize is actually big enough */
size_t minsize = lfb_resolution_s * lfb_resolution_y * 4;
if (lfb_memsize < minsize) lfb_memsize = minsize;
finalize_graphics("preset");
}