Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused ValueFormat fields read as i16 unstead of u16 #73

Closed
wezm opened this issue Jun 15, 2022 · 0 comments
Closed

Unused ValueFormat fields read as i16 unstead of u16 #73

wezm opened this issue Jun 15, 2022 · 0 comments

Comments

@wezm
Copy link
Contributor

wezm commented Jun 15, 2022

allsorts/src/layout.rs

Lines 1285 to 1296 in 63c3f48

if value_format.has_x_placement_device() {
let _ = ctxt.read_i16be()?;
}
if value_format.has_y_placement_device() {
let _ = ctxt.read_i16be()?;
}
if value_format.has_x_advance_device() {
let _ = ctxt.read_i16be()?;
}
if value_format.has_y_advance_device() {
let _ = ctxt.read_i16be()?;
}

These fields, whilst unused are offsets (Offset16) which the spec says:

Short offset to a table, same as uint16

So they should be read_u16be. Since they're unused this isn't a problem in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant