Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Miguel Gimenez on October 01, 2022, 09:40:21 am

Title: Crash when using with SVG files
Post by: Miguel Gimenez on October 01, 2022, 09:40:21 am
I am adapting the code to HiDPI after wx3.1.6 using wxBitmapBundle (see ticket #1297 for details), and I have discovered that wxBitmapBundle::FromSVG() method produces random crashes because the underlying library (nanoSVG) is buggy:
  - first crash is in nsvg_Parse(). This only happens on non-english locales, is fixed in nanoSVG trunk but not in wxWidgets, and a workaround is locale switching before calling FromSVG().
  - second crash is in nsvg__addEdge(). AFAIK this is not fixed and there is no workaround.

Because of this, I will temporarily remove calls to wxBitmapBundle::FromSVG() along this weekend.
Title: Re: Crash when using with SVG files
Post by: AndrewCot on October 01, 2022, 10:46:51 am
Straight up: I am not happy with the process used and the way the SVN changes have been made.
Going forward:
 Can a new interface be added so that the changes in the vast majority of code calls one function/class and this class/function has the smarts to either use the existing PNG or the new SVG files. This has the advantage on only modifying the existing code:
Title: Re: Crash when using with SVG files
Post by: gd_on on October 02, 2022, 12:53:52 pm
In my own software, I use wxBitmapBundle::FromSVGFile() in wxWidgets 3.2.1 and never met such problems (until now ???)
Title: Re: Crash when using with SVG files
Post by: Miguel Gimenez on October 02, 2022, 01:42:20 pm
It was a misunderstanfing on my side, it is fixed now.
Title: Re: Crash when using with SVG files
Post by: ollydbg on October 02, 2022, 04:53:36 pm
It was a misunderstanfing on my side, it is fixed now.

Good work.