From c3253eea0d3518c79cc4b5a014c3dfa339fe770b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 18 Oct 2021 18:25:57 +0200 Subject: [PATCH] zapit: avoid unaligned access in parseBouquetsXml() SH4 kernels are complaining about unaligned accesses when bouquets.xml with urls are parsed. Even though this should be fixed in the XML parsing library, this seems not easy, so let's add a simple workaround to avoid the messages in the kernel log. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/cdb83748f1745b1736543603d34c9bc64244f780 Author: Stefan Seyfried Date: 2021-10-18 (Mon, 18 Oct 2021) ------------------ This commit was generated by Migit --- src/zapit/src/bouquets.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 5e766b554..3c3d95701 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -449,6 +449,9 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) if (uName) uname = uName; const char *url = xmlGetAttribute(channel_node, "u"); + if (url && ((uintptr_t)url % 4)) + url = std::string(url).c_str(); /* hack to ensure buffer is aligned */ + GET_ATTR(channel_node, "i", SCANF_SERVICE_ID_TYPE, service_id); GET_ATTR(channel_node, "on", SCANF_ORIGINAL_NETWORK_ID_TYPE, original_network_id); GET_ATTR(channel_node, "s", SCANF_SATELLITE_POSITION_TYPE, satellitePosition);