#680 TLP_DIR badly set

4.0.0
closed-fixed
MMathiaut
5
2013-02-01
2013-01-31
BeNours
No

Reproductible on Windows and Linux:
If the TLP_DIR is set, but with a bad path, nothing is done to verify that the path is valid when initializing tulip.

In consequence, when we have a GLscene that will be drawn:
1. a GLNode is created.
2. In this GlNode, a GlLabel is created.
3. In its constructor, is called the initialization. And the initialization uses TulipBitmapDir + "font.ttf", that is created from TLP_DIR
4. No check is made to verify that the font is created correctly by ftgl.
5. Next, always in GlLabel::init(), is called font->FaceSize(fontSize);
But if the file is not found, we obtain an error at: FTSize.cpp:49: face is NULL but no test on it is made.

It result in the access of a bad memory place, and will crash the application.
Nothing in release permits to detect this problem. And in debug, it takes several times to find it.

It would be usefull:
1. to check that TLP_DIR is a valid path, containing all necessary files used by tulip
2. to check when using a file, that this file is valid, or to check that the object loading the file is valid

Discussion

  • BeNours
    BeNours
    2013-01-31

    The tulip used is Tulip 4.1

     
  • Patrick Mary
    Patrick Mary
    2013-02-01

    • status: open --> closed-fixed
     
  • Patrick Mary
    Patrick Mary
    2013-02-01

    Thank you very much for your feedback.
    This bug is now fixed in the current svn code line.