mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
WindowServer: Don't crash when we can't allocate a bitmap
When the client specifies an absurdly large window size render_to_cache() fails to allocate a bitmap and crashes. Refs #7688.
This commit is contained in:
parent
2df6c70b07
commit
cdb070cdfb
1 changed files with 6 additions and 0 deletions
|
@ -409,8 +409,14 @@ void WindowFrame::render_to_cache()
|
||||||
if (s_tmp_bitmap)
|
if (s_tmp_bitmap)
|
||||||
s_tmp_bitmap->unref();
|
s_tmp_bitmap->unref();
|
||||||
s_tmp_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, total_frame_rect.size(), scale).leak_ref();
|
s_tmp_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, total_frame_rect.size(), scale).leak_ref();
|
||||||
|
if (!s_tmp_bitmap) {
|
||||||
|
dbgln("Could not create bitmap of size {}", total_frame_rect.size());
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VERIFY(s_tmp_bitmap);
|
||||||
|
|
||||||
auto top_bottom_height = total_frame_rect.height() - window_rect.height();
|
auto top_bottom_height = total_frame_rect.height() - window_rect.height();
|
||||||
auto left_right_width = total_frame_rect.width() - window_rect.width();
|
auto left_right_width = total_frame_rect.width() - window_rect.width();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue