[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master 8a6ee67 12/13: [ftinspect] Check glyph index be
From: |
Werner LEMBERG |
Subject: |
[freetype2-demos] master 8a6ee67 12/13: [ftinspect] Check glyph index before discarding sign. |
Date: |
Thu, 11 May 2017 15:26:24 -0400 (EDT) |
branch: master
commit 8a6ee679d53bcb0adbe163c49f94c2860ae4c29f
Author: Philipp Kerling <address@hidden>
Commit: Werner Lemberg <address@hidden>
[ftinspect] Check glyph index before discarding sign.
* src/ftinspect.cpp (Engine:glyphName, Engine::loadOutline): Do it.
---
ChangeLog | 6 ++++++
src/ftinspect.cpp | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 37f3fcb..bc34941 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2017-05-11 Philipp Kerling <address@hidden>
+ [ftinspect] Check glyph index before discarding sign.
+
+ * src/ftinspect.cpp (Engine:glyphName, Engine::loadOutline): Do it.
+
+2017-05-11 Philipp Kerling <address@hidden>
+
* src/ftinspect.cpp (GlyphPointNumbers::paint): Fix `ptIdx' type.
2017-05-11 Philipp Kerling <address@hidden>
diff --git a/src/ftinspect.cpp b/src/ftinspect.cpp
index 41e4c3c..4f93ef5 100644
--- a/src/ftinspect.cpp
+++ b/src/ftinspect.cpp
@@ -462,6 +462,9 @@ Engine::glyphName(int index)
{
QString name;
+ if (index < 0)
+ throw std::runtime_error("Invalid glyph index");
+
if (ftSize && FT_HAS_GLYPH_NAMES(ftSize->face))
{
char buffer[256];
@@ -481,6 +484,9 @@ Engine::loadOutline(int glyphIndex)
{
update();
+ if (glyphIndex < 0)
+ throw std::runtime_error("Invalid glyph index");
+
FT_Glyph glyph;
// XXX handle bitmap fonts
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master 8a6ee67 12/13: [ftinspect] Check glyph index before discarding sign.,
Werner LEMBERG <=