FLTK logo

[fltk/fltk] SIGSEGV with OPTION_USE_PANGO and fl_draw(const char *, int, int, int, int, Fl_Align) when strlen == 1 (#276)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[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>

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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.