summaryrefslogtreecommitdiff
path: root/Applications/FontEditor
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-06 19:04:30 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-06 19:04:30 +0100
commitb46c7da0a488b2e21d9ecaa8c78e7ebcbc2ed0ea (patch)
treeb407d2ee73a9aa810bf1113a1784554780b10d99 /Applications/FontEditor
parent31d6b640eb2d7fcb529aa8c44426c26affc1c7b2 (diff)
downloadserenity-b46c7da0a488b2e21d9ecaa8c78e7ebcbc2ed0ea.zip
FontEditor: Don't crash when clicking on the unused part of a glyph.
Diffstat (limited to 'Applications/FontEditor')
-rw-r--r--Applications/FontEditor/FontEditor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Applications/FontEditor/FontEditor.cpp b/Applications/FontEditor/FontEditor.cpp
index 243cb7bde5..2207e2618f 100644
--- a/Applications/FontEditor/FontEditor.cpp
+++ b/Applications/FontEditor/FontEditor.cpp
@@ -269,8 +269,10 @@ void GlyphEditorWidget::draw_at_mouse(const GMouseEvent& event)
int x = (event.x() - 1) / m_scale;
int y = (event.y() - 1) / m_scale;
auto bitmap = font().glyph_bitmap(m_glyph);
- ASSERT(x < bitmap.width());
- ASSERT(y < bitmap.height());
+ if (x >= bitmap.width())
+ return;
+ if (y >= bitmap.height())
+ return;
if (bitmap.bit_at(x, y) == set)
return;
bitmap.set_bit_at(x, y, set);