-
Notifications
You must be signed in to change notification settings - Fork 18k
x/image/font/sfnt: fails to parse legacy TrueType font #28339
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
Labels
Milestone
Comments
/cc @nigeltao |
Change https://golang.org/cl/144079 mentions this issue: |
Change https://golang.org/cl/146081 mentions this issue: |
mrhyperbit23z0d
added a commit
to mrhyperbit23z0d/bhegde8
that referenced
this issue
Jun 6, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
GalaxyForcew
added a commit
to GalaxyForcew/A1bisshy
that referenced
this issue
Jun 6, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
yi-ge3
added a commit
to yi-ge3/wislie
that referenced
this issue
Jun 6, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
balloontmz6
added a commit
to balloontmz6/Likewise42l
that referenced
this issue
Jun 6, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
snapbakkhfbav
added a commit
to snapbakkhfbav/SayedBaladohr
that referenced
this issue
Oct 6, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
MiderWong5ddop
added a commit
to MiderWong5ddop/sidie88f
that referenced
this issue
Oct 7, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
rorypeckwnt4v
added a commit
to rorypeckwnt4v/LearnByBhanuPrataph
that referenced
this issue
Oct 7, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
egorovcharenko9
added a commit
to egorovcharenko9/RiceBIOC470z
that referenced
this issue
Oct 7, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
RafayGhafoorf
added a commit
to RafayGhafoorf/dustinsand8
that referenced
this issue
Oct 7, 2022
Library assumes that OS/2 header size is at least 96 bytes, which is not the case for fonts with OS/2 table version <= 1. This CL adds a version test and handles the legacy header. Fixes golang/go#28339 Change-Id: I79bd8f8bbf262c1caaf4e66888446159b5e4fb43 Reviewed-on: https://go-review.googlesource.com/c/144079 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What did you do?
Parse the FreeSans.ttf file:
What did you expect to see?
no error
What did you see instead?
Details
The code check the size of the
OS/2
header without asserting a version. The file that triggers an issue has aversion = 1
, which has a header size of 86 bytes instead of minimal 96 bytes required by the library.See https://docs.microsoft.com/da-dk/typography/opentype/spec/os2 for more details.
The text was updated successfully, but these errors were encountered: