The previous fix that made sure we returned the actual data in KCompressionDevice::readData
because it is sometimes buffered, didn't take into account this line
QByteArray dummy(qMin(bytesToRead, qint64(SEEK_BUFFER_SIZE)), 0);
in KCompressionDevice::seek, i.e. sometimes the dummy buffer is not as big as we need to seek,
basically because we don't want to be allocating lots of memory.
The previous solution worked because never incremented the data pointer, that meant that the
internal QIODevice buffer might end in a bad state, so we fixed it but forgot about the case
where the dummy buffer we're using is not big enough and this was causing invalid memory writes.
To fix that now we have a while loop that reads as many times over the dummy buffer to seek
to the correct position.
Comes with an extended autottest, that has a big buffer and without this fix would crash.