Skip to content

Commit

Permalink
zapit: avoid unaligned access in parseBouquetsXml()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
seife authored and vanhofen committed Oct 18, 2021
1 parent 2da6d13 commit cdb8374
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/zapit/src/bouquets.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit cdb8374

Please sign in to comment.