Fix endianness bug in PCX reader’s peekHeader() method on big endian architectures
When reading from a sequential device, the peekHeader() method in the PCX reader reads the header from its defined little endian endianness into the arch-specific endianness of the current architecture for multibyte types.
Being a "peek" method, it then tries to push back the bytes into the device after reading for its next use, but it doesn’t convert multibyte types correctly from arch-specifice endianness back into the initial little endian format.
Subsequent reading of the data from the device will thus lead to incorrect values for multibyte types on the next use, where quint16 types in the header have their bytes swapped.
This patch reuses the same technique as the TGA reader to read the whole header as bytes before deserializing it, so that the bytes can be pushed back into the sequential device in the same order.
This bug breaks the build-time tests on the big endian s390x architecture in Debian : https://buildd.debian.org/status/fetch.php?pkg=kf6-kimageformats&arch=s390x&ver=6.6.0-1&stamp=1726892955&raw=0
The fix builds on all our arches where build dependencies are currently available (12) : https://buildd.debian.org/status/package.php?p=kf6-kimageformats&suite=sid