summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-04-27 13:54:08 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-04-27 13:54:08 +0000
commitcbbec03b5e44e8855dbcf424150be5e144044fb2 (patch)
tree9625073d933fbfe1604e7f38f694e8bfef8a1f2c
parent8ffe967089c32a11af2a9d219d79dc9cd9858dd4 (diff)
fl_font(0, 0) as a first call in Xft would try to access a member in fl_fontsize, which was still set to NULL. This fix is untersted as I don't have a Unix machine here. Please verify this fix!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5035 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES2
-rw-r--r--src/fl_font_xft.cxx5
2 files changed, 5 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index ccca08263..ebbe491a9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - Calling fl_font(0, 0) under Xft would access a NULL
+ pointer (STR #1205)
- Setting a new value in Fl_Input_ wil now actually move
cursor to the end of the input field as documented
(STR #1161)
diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx
index d608896bc..1c6a451da 100644
--- a/src/fl_font_xft.cxx
+++ b/src/fl_font_xft.cxx
@@ -95,8 +95,9 @@ const char* fl_encoding_ = "iso8859-1";
Fl_FontSize* fl_fontsize = 0;
void fl_font(int fnum, int size) {
- if (fnum == fl_font_ && size == fl_size_ &&
- !strcasecmp(fl_fontsize->encoding, fl_encoding_))
+ if (fnum == fl_font_ && size == fl_size_
+ && fl_fontsize
+ && !strcasecmp(fl_fontsize->encoding, fl_encoding_))
return;
fl_font_ = fnum; fl_size_ = size;
Fl_Fontdesc *font = fl_fonts + fnum;