summaryrefslogtreecommitdiff
path: root/src/gui/fonts/font.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-03-08 19:53:04 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-08 20:07:45 +0300
commitd0994f4298641d65700b1bbc90b4ba6effa58320 (patch)
tree29682232ae58e19965281da6da69702c5dc18d39 /src/gui/fonts/font.cpp
parent70081e3b1185eb661c0fa50a9f7d20cecdd30f54 (diff)
downloadmv-d0994f4298641d65700b1bbc90b4ba6effa58320.tar.gz
mv-d0994f4298641d65700b1bbc90b4ba6effa58320.tar.bz2
mv-d0994f4298641d65700b1bbc90b4ba6effa58320.tar.xz
mv-d0994f4298641d65700b1bbc90b4ba6effa58320.zip
Add assert in fonts loading if font size < 4.
Diffstat (limited to 'src/gui/fonts/font.cpp')
-rw-r--r--src/gui/fonts/font.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp
index 488a2212b..c8f1a3561 100644
--- a/src/gui/fonts/font.cpp
+++ b/src/gui/fonts/font.cpp
@@ -99,7 +99,7 @@ extern char *strBuf;
static int fontCounter;
Font::Font(std::string filename,
- const int size,
+ int size,
const int style) :
mFont(nullptr),
mCreateCounter(0),
@@ -116,6 +116,14 @@ Font::Font(std::string filename,
}
}
+ if (size < 4)
+ {
+ reportAlways("Error: requested load font %s with size %d",
+ filename.c_str(),
+ size);
+ size = 4;
+ }
+
if (!fontCounter)
{
strBuf = new char[65535];