Add line data padding when necessary. Additionally I realize we should convert to little-endian after checking the bytesperline oddness (this bug was most likely unnoticed until now as most desktop proc are little endian now anyway). (cherry picked from commit 5d319b77)