diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-06 19:04:30 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-06 19:04:30 +0100 |
commit | b46c7da0a488b2e21d9ecaa8c78e7ebcbc2ed0ea (patch) | |
tree | b407d2ee73a9aa810bf1113a1784554780b10d99 /Applications/FontEditor | |
parent | 31d6b640eb2d7fcb529aa8c44426c26affc1c7b2 (diff) | |
download | serenity-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.cpp | 6 |
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); |