Commit Graph

3 Commits

Author SHA1 Message Date
Nikhil Ramakrishnan f67786de4d [woff2] Check whether known tag is in array bounds.
If table tag is not 0x3f, we expect a value between 0 and 62. If this is
not the case, exit with errors.

* src/sfnt/sfwoff2/c: Check whether table tag makes sense.

* src/sfnt/woff2tags.c: Return 0 if tag is out of bounds.
2019-08-22 16:46:03 +05:30
Nikhil Ramakrishnan 045c6b1162 [woff2] Get known tags from function.
Change `KnownTags' to a function (`woff2_known_tags'). This avoids
introducing a global constant array. This function returns the specified
index without *any* checks. The caller must ensure that `index' is
within array limits.

* src/sfnt/sfwoff2.c (woff2_open_font): Change `KnownTags[...]' notation
to `woff2_known_tags( ... )'.

* src/sfnt/woff2tags.c: Perform changes.

* src/sfnt/woff2tags.h: Update definitions.
2019-06-30 20:01:20 +05:30
Nikhil Ramakrishnan f1083eae5e [sfnt] Add WOFF2 constants.
Add constants required for WOFF2, and known table tags as defined in the
specification. See

  https://www.w3.org/TR/WOFF2/#table_dir_format

for details.

* src/sfnt/woff2tags.c, src/sfnt/woff2tags.h: New files.
2019-06-16 19:09:08 +05:30