From cbbec03b5e44e8855dbcf424150be5e144044fb2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 27 Apr 2006 13:54:08 +0000 Subject: [PATCH] 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 --- CHANGES | 2 ++ src/fl_font_xft.cxx | 5 +++-- 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;