diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-24 08:18:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-24 08:18:34 +0200 |
commit | 8f2425125e79240d2ff9161297438b4012de826f (patch) | |
tree | c978b7cad959ecfea50ff388102eacf629691e40 | |
parent | 22d877843782086da2c0e12495f13f6c4bc6b4f7 (diff) | |
download | serenity-8f2425125e79240d2ff9161297438b4012de826f.zip |
LibGfx+Base: Tweak bitmap fonts to ensure glyph data is 4-byte aligned
When building userland with UBSAN enabled (#7434), we were getting
spammed to death by unaligned access errors.
Fix these by adding 2 bytes of padding to the FontFileHeader struct,
and adjusting all our font files to match the new format. :^)
24 files changed, 3 insertions, 0 deletions
diff --git a/Base/res/fonts/CsillaBold10.font b/Base/res/fonts/CsillaBold10.font Binary files differindex a69c20761a..f6ac94a81b 100644 --- a/Base/res/fonts/CsillaBold10.font +++ b/Base/res/fonts/CsillaBold10.font diff --git a/Base/res/fonts/CsillaBold12.font b/Base/res/fonts/CsillaBold12.font Binary files differindex 0bd7090a73..39d96b4aa3 100644 --- a/Base/res/fonts/CsillaBold12.font +++ b/Base/res/fonts/CsillaBold12.font diff --git a/Base/res/fonts/CsillaRegular10.font b/Base/res/fonts/CsillaRegular10.font Binary files differindex 6e5815f9bc..090f2f265b 100644 --- a/Base/res/fonts/CsillaRegular10.font +++ b/Base/res/fonts/CsillaRegular10.font diff --git a/Base/res/fonts/CsillaRegular12.font b/Base/res/fonts/CsillaRegular12.font Binary files differindex bd52e33142..cd367a3f1e 100644 --- a/Base/res/fonts/CsillaRegular12.font +++ b/Base/res/fonts/CsillaRegular12.font diff --git a/Base/res/fonts/KaticaBold10.font b/Base/res/fonts/KaticaBold10.font Binary files differindex efba786f18..9ff2641f8b 100644 --- a/Base/res/fonts/KaticaBold10.font +++ b/Base/res/fonts/KaticaBold10.font diff --git a/Base/res/fonts/KaticaBold12.font b/Base/res/fonts/KaticaBold12.font Binary files differindex 831ee25d1a..b468c9d44b 100644 --- a/Base/res/fonts/KaticaBold12.font +++ b/Base/res/fonts/KaticaBold12.font diff --git a/Base/res/fonts/KaticaRegular10.font b/Base/res/fonts/KaticaRegular10.font Binary files differindex 21e2fb5521..bf4e9ac27b 100644 --- a/Base/res/fonts/KaticaRegular10.font +++ b/Base/res/fonts/KaticaRegular10.font diff --git a/Base/res/fonts/KaticaRegular12.font b/Base/res/fonts/KaticaRegular12.font Binary files differindex 2f23e5f059..92543ea33c 100644 --- a/Base/res/fonts/KaticaRegular12.font +++ b/Base/res/fonts/KaticaRegular12.font diff --git a/Base/res/fonts/LizaBlack10.font b/Base/res/fonts/LizaBlack10.font Binary files differindex 1cd3047606..07ce71144d 100644 --- a/Base/res/fonts/LizaBlack10.font +++ b/Base/res/fonts/LizaBlack10.font diff --git a/Base/res/fonts/LizaBlack24.font b/Base/res/fonts/LizaBlack24.font Binary files differindex 763cdbce3d..400da329bf 100644 --- a/Base/res/fonts/LizaBlack24.font +++ b/Base/res/fonts/LizaBlack24.font diff --git a/Base/res/fonts/LizaBlack36.font b/Base/res/fonts/LizaBlack36.font Binary files differindex 05c9fe5ab0..06cdc8e59b 100644 --- a/Base/res/fonts/LizaBlack36.font +++ b/Base/res/fonts/LizaBlack36.font diff --git a/Base/res/fonts/LizaBold10.font b/Base/res/fonts/LizaBold10.font Binary files differindex 7ee0a363a1..292a30bc61 100644 --- a/Base/res/fonts/LizaBold10.font +++ b/Base/res/fonts/LizaBold10.font diff --git a/Base/res/fonts/LizaBold24.font b/Base/res/fonts/LizaBold24.font Binary files differindex 05f3a3f438..828fc1fff7 100644 --- a/Base/res/fonts/LizaBold24.font +++ b/Base/res/fonts/LizaBold24.font diff --git a/Base/res/fonts/LizaBold36.font b/Base/res/fonts/LizaBold36.font Binary files differindex 9a14fc4112..eb3a0bfe15 100644 --- a/Base/res/fonts/LizaBold36.font +++ b/Base/res/fonts/LizaBold36.font diff --git a/Base/res/fonts/LizaRegular10.font b/Base/res/fonts/LizaRegular10.font Binary files differindex 8f355d050a..07d9817fd0 100644 --- a/Base/res/fonts/LizaRegular10.font +++ b/Base/res/fonts/LizaRegular10.font diff --git a/Base/res/fonts/LizaRegular24.font b/Base/res/fonts/LizaRegular24.font Binary files differindex cd1402432d..34166ef6c1 100644 --- a/Base/res/fonts/LizaRegular24.font +++ b/Base/res/fonts/LizaRegular24.font diff --git a/Base/res/fonts/LizaRegular36.font b/Base/res/fonts/LizaRegular36.font Binary files differindex 6ff5fca2d8..a6abb1ee01 100644 --- a/Base/res/fonts/LizaRegular36.font +++ b/Base/res/fonts/LizaRegular36.font diff --git a/Base/res/fonts/MarietaBold24.font b/Base/res/fonts/MarietaBold24.font Binary files differindex d9ba2f19d4..4948313eb7 100644 --- a/Base/res/fonts/MarietaBold24.font +++ b/Base/res/fonts/MarietaBold24.font diff --git a/Base/res/fonts/MarietaBold36.font b/Base/res/fonts/MarietaBold36.font Binary files differindex 24d6990fda..e6f9a3a845 100644 --- a/Base/res/fonts/MarietaBold36.font +++ b/Base/res/fonts/MarietaBold36.font diff --git a/Base/res/fonts/MarietaRegular24.font b/Base/res/fonts/MarietaRegular24.font Binary files differindex abeb38a568..d80ed4dc28 100644 --- a/Base/res/fonts/MarietaRegular24.font +++ b/Base/res/fonts/MarietaRegular24.font diff --git a/Base/res/fonts/MarietaRegular36.font b/Base/res/fonts/MarietaRegular36.font Binary files differindex 850fce272c..6038115b9d 100644 --- a/Base/res/fonts/MarietaRegular36.font +++ b/Base/res/fonts/MarietaRegular36.font diff --git a/Base/res/fonts/PebbletonBold14.font b/Base/res/fonts/PebbletonBold14.font Binary files differindex 4bdfb0eee9..6ccce1d950 100644 --- a/Base/res/fonts/PebbletonBold14.font +++ b/Base/res/fonts/PebbletonBold14.font diff --git a/Base/res/fonts/PebbletonRegular14.font b/Base/res/fonts/PebbletonRegular14.font Binary files differindex 3ec8335390..6a15c0b090 100644 --- a/Base/res/fonts/PebbletonRegular14.font +++ b/Base/res/fonts/PebbletonRegular14.font diff --git a/Userland/Libraries/LibGfx/BitmapFont.cpp b/Userland/Libraries/LibGfx/BitmapFont.cpp index a50ba1b454..a8b844f359 100644 --- a/Userland/Libraries/LibGfx/BitmapFont.cpp +++ b/Userland/Libraries/LibGfx/BitmapFont.cpp @@ -35,8 +35,11 @@ struct [[gnu::packed]] FontFileHeader { u16 weight; char name[32]; char family[32]; + u16 unused; }; +static_assert(sizeof(FontFileHeader) == 80); + NonnullRefPtr<Font> BitmapFont::clone() const { size_t bytes_per_glyph = sizeof(u32) * glyph_height(); |