summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp
index 5beed09611..211acd229a 100644
--- a/Userland/Libraries/LibGfx/Bitmap.cpp
+++ b/Userland/Libraries/LibGfx/Bitmap.cpp
@@ -117,8 +117,8 @@ ErrorOr<NonnullRefPtr<Bitmap>> Bitmap::try_load_from_file(String const& path, in
auto fd = TRY(Core::System::open(highdpi_icon_string, O_RDONLY));
auto bitmap = TRY(try_load_from_fd_and_close(fd, highdpi_icon_string));
- VERIFY(bitmap->width() % scale_factor == 0);
- VERIFY(bitmap->height() % scale_factor == 0);
+ if (bitmap->width() % scale_factor != 0 || bitmap->height() % scale_factor != 0)
+ return Error::from_string_literal("Bitmap::try_load_from_file: HighDPI image size should be divisible by scale factor");
bitmap->m_size.set_width(bitmap->width() / scale_factor);
bitmap->m_size.set_height(bitmap->height() / scale_factor);
bitmap->m_scale = scale_factor;