Fix debug output.

If we have fewer bytes left in the buffer than
the output alignment, we would read out of bounds
and output (partially) incorrect data.

Test: debug output is correct
Change-Id: I66913c58295ccd8e1955a73a17f6eed45ca6cd1e
1 file changed