On Thu Oct 5 12:56:22 2023 +0000, Nikolay Sivov wrote:
This does not do any validation regarding reading past the end of the table. Also format 2 should be using binary search, and not a loop.
I don't see how this could read past the end of the table, the size of the allocated memory is determined by `ClassRangeCount` in `load_GDEF` so all of this memory is allocated. I'm assuming that if the font section was too small, that `font_funcs->get_font_data` would return an error and thus `font->gdef_table` would be `NULL`, which is handled at the top of this function.
Regardless, this should use a bsearch, I think I did it this way because I was initially copying some code for parsing a different table which used a for loop.