Skip to content

Accidentally passing filename as data to StbTrueTypeFont causes crash #29

@mosra

Description

@mosra

I did this by accident on a StbTrueTypeFont plugin instance:

font->openSingleData("/usr/share/fonts/DejaVuSans.ttf", 18.0f);

Yes, the filename does not even exist (there's the TTF/ subdirectory missing), but in any case this was a filename passed in as "TTF file data" and it crashed deep in stb_truetype. Things to do:

  • Check that I'm not doing anything wrong in the plugin (for example passing the data array with unbounded size) yeah, totally my fault
  • Make a repro case, report upstream no need (well, actually it would be much better if the stb_truetype APIs took pointer+size instead of just pointer, but that's a more fundamental issue)
  • Update to latest stb_truetype in src/external/stb -- 986bace

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions