You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For 'glyf' and 'loca' tables, transformation version 3 indicates the null transform...
The relevant code in [woff2.rs](https://github.com/yeslogic/allsorts/blob/1d05ffa243d857770b45d2b0244bb2d747520bd4/src/woff2.rs#L312) is apparently trying to account for this by doing masking to get the values of bits 6 and 7...
However, if those two flag bits do actually equal 3, indicating the null transform for glyf or loca, this match statement will not get the intended result because the actual value of transformation_version will be 0xc0 (0b11000000 -- bits 6 and 7 are both true). As a consequence, that U32Base128 will be read erroneously, advancing the offset when it shouldn't, resulting in a bad file read when the reader would eventually read past the end of the file.
It seems that there either needs to be a bit shift, shifting bits 6 and 7 all the way over to test against the value of 3, or else the unshifted value should be tested against 0xc0.
The text was updated successfully, but these errors were encountered:
According to the WOFF2 spec:
The relevant code in
[woff2.rs](https://github.com/yeslogic/allsorts/blob/1d05ffa243d857770b45d2b0244bb2d747520bd4/src/woff2.rs#L312)
is apparently trying to account for this by doing masking to get the values of bits 6 and 7......and then checking for whether the value is 3 for
glyf
orloca
:However, if those two flag bits do actually equal 3, indicating the null transform for glyf or loca, this
match
statement will not get the intended result because the actual value oftransformation_version
will be0xc0
(0b11000000
-- bits 6 and 7 are bothtrue
). As a consequence, thatU32Base128
will be read erroneously, advancing the offset when it shouldn't, resulting in a bad file read when the reader would eventually read past the end of the file.It seems that there either needs to be a bit shift, shifting bits 6 and 7 all the way over to test against the value of
3
, or else the unshifted value should be tested against0xc0
.The text was updated successfully, but these errors were encountered: