diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-15 11:57:24 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-15 12:28:49 +0200 |
commit | 228ace854c2c5bca7646d12789b240594ea94111 (patch) | |
tree | 54ad0eee1a08cbe804b7a5aca4c85b2af2b68ab3 /Libraries/LibGUI/Window.h | |
parent | a8406aa117839357277d11966359613bc0a2828f (diff) | |
download | serenity-228ace854c2c5bca7646d12789b240594ea94111.zip |
LibGfx: Don't allow creating bitmaps whose sizes would overflow
If the area or size_in_bytes calculation for a Gfx::Bitmap would
overflow, we now refuse to create such a bitmap and return nullptr.
Thanks to @itamar8910 for finding this! :^)
Diffstat (limited to 'Libraries/LibGUI/Window.h')
-rw-r--r-- | Libraries/LibGUI/Window.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/Window.h b/Libraries/LibGUI/Window.h index f8fe54652d..59d20a1bcd 100644 --- a/Libraries/LibGUI/Window.h +++ b/Libraries/LibGUI/Window.h @@ -189,8 +189,8 @@ protected: private: virtual bool is_window() const override final { return true; } - NonnullRefPtr<Gfx::Bitmap> create_backing_bitmap(const Gfx::Size&); - NonnullRefPtr<Gfx::Bitmap> create_shared_bitmap(Gfx::BitmapFormat, const Gfx::Size&); + RefPtr<Gfx::Bitmap> create_backing_bitmap(const Gfx::Size&); + RefPtr<Gfx::Bitmap> create_shared_bitmap(Gfx::BitmapFormat, const Gfx::Size&); void set_current_backing_bitmap(Gfx::Bitmap&, bool flush_immediately = false); void flip(const Vector<Gfx::Rect, 32>& dirty_rects); void force_update(); |