Aztec: Fix padding if the last partial codeword is all one bits

Authored by vkrause on May 1 2019, 3:09 PM.

Description

Aztec: Fix padding if the last partial codeword is all one bits

Summary:
Wikipedia says "after bit stuffing, the data string is padded to the next
codeword boundary by appending 1 bits. If this would result in a code word
of all ones, the last bit is changed to zero", we were missing the second
part here.

While this difference wouldn't confuse the decoder normally, it is also
fed into the Reed-Solomon encoder, and thus spread out and multiplied,
resulting in a non-decodeable image.

This is sufficiently unlikely (needs a content ending with a binary
content with enough bits set, and unfortunate alignment of the bit
stream), which is why this went unnoticed for quite a while.

Reviewers: svuorela, nicolasfella

Reviewed By: svuorela

Subscribers: kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D20939

Details

Committed
vkrauseMay 3 2019, 3:24 PM
Reviewer
svuorela
Differential Revision
D20939: Aztec: Fix padding if the last partial codeword is all one bits
Parents
R280:518b8ec9546f: GIT_SILENT Upgrade KF5 version to 5.58.0.
Branches
Unknown
Tags
Unknown