1
0
mirror of https://github.com/termux/termux-packages synced 2024-06-18 20:40:45 +00:00
termux-packages/packages/vtm/netxs-desktopio-directvt.hpp.patch
Tee KOBAYASHI c55303d60f vtm: Restore patch to fix alignment of data
as a follow-up of commit 8f2c1b0fe4.

Please always test on arm (32-bit) arch if you modify or delete it.
2023-01-22 10:02:59 +00:00

18 lines
770 B
Diff

https://github.com/termux/termux-packages/issues/13594
Please always test on arm (32-bit) arch if you modify or delete this patch.
--- a/src/netxs/desktopio/directvt.hpp
+++ b/src/netxs/desktopio/directvt.hpp
@@ -182,7 +182,9 @@ namespace netxs::directvt
log("dtvt: corrupted integer data");
return D{};
}
- auto crop = netxs::letoh(*reinterpret_cast<D const*>(data.data()));
+ auto data_aligned = D{};
+ ::memcpy(&data_aligned, data.data(), sizeof(D));
+ auto crop = netxs::letoh(data_aligned);
if constexpr (!PeekOnly)
{
data.remove_prefix(sizeof(D));