diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-03-07 16:29:31 +0100 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2016-03-23 10:42:45 +0000 |
commit | 2119b86db25fac3165c562f9d40e5874de824c80 (patch) | |
tree | c008d1133fbbb5d228f3fb544708a6577adb8301 /src/plugins/platforms/minimal | |
parent | 282cf63554fa55b43147f6377525ad990b14ec56 (diff) |
QRawFont: fix UB in supportedWritingSystems()
Found by UBSan:
src/gui/text/qrawfont.cpp:647:55: runtime error: load of misaligned address 0x000001eeed26 for type 'quint32', which requires 4 byte alignment
src/gui/text/qrawfont.cpp:648:50: runtime error: load of misaligned address 0x000001eeed02 for type 'quint32', which requires 4 byte alignment
Fix by using the qFromBigEndian() overload that can read from
unaligned memory.
While touching the code, also disentangle the two loops so that
operations are now performed in memory order instead of inter-
leaved, use less magic numbers, and avoid a QByteArray detach.
Change-Id: I26fa39726f6fa2e957b60863fa160280cf1dc9ac
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/plugins/platforms/minimal')
0 files changed, 0 insertions, 0 deletions