|
|
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>
class MyBox : public Fl_Box {
public:
MyBox(int x, int y, int w, int h, const char* label = NULL)
: Fl_Box(x, y, w, h, label) {
box(FL_DOWN_BOX);
color(FL_WHITE);
}
void draw() {
Fl_Box::draw();
fl_color(FL_BLACK);
fl_draw("s", x() + 10, y() + 5, w() - 20, h(), FL_ALIGN_LEFT | FL_ALIGN_CENTER);
}
};
int main() {
auto win = new Fl_Double_Window(400, 300);
auto my_box = new MyBox(160, 200, 80, 30);
win->end();
win->show();
return Fl::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.
[ Direct Link to Message ] | |
|
| |