[fltk/fltk] SIGSEGV with OPTION_USE_PANGO and fl_draw(const char *, int, int, int, int, Fl_Align) when strlen == 1 (#276)
Mohammed Alyousef
Sep 28, 2021
Hello
On Linux, Compiling FLTK 1.4 with OPTION_USE_PANGO=ON, then using fl_draw(const char *, int, int, int, int, Fl_Align) causes a segmentation fault when strlen == 1.
Minimal repro:
#include<FL/Enumerations.H>
#include<FL/Fl.H>
#include<FL/Fl_Box.H>
#include<FL/Fl_Double_Window.H>
#include<FL/fl_draw.H>classMyBox : publicFl_Box {
public:MyBox(int x, int y, int w, int h, constchar* label = NULL)
: Fl_Box(x, y, w, h, label) {
box(FL_DOWN_BOX);
color(FL_WHITE);
}
voiddraw() {
Fl_Box::draw();
fl_color(FL_BLACK);
fl_draw("s", x() + 10, y() + 5, w() - 20, h(), FL_ALIGN_LEFT | FL_ALIGN_CENTER);
}
};
intmain() {
auto win = newFl_Double_Window(400, 300);
auto my_box = newMyBox(160, 200, 80, 30);
win->end();
win->show();
returnFl::run();
}
Passing a string with any other length or NULL doesn't cause a segfault. Also not using pango, doesn't cause a segfault (with the default Xft font backend).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.