What value does QImage::byteCount() return? Scanlines must be 32-bit aligned, which generally introduces some padding; though there shouldn't be any if your image is 8 pixels wide and 8 bits deep.
By the way, you do not need to go through a temporary buffer. Just read into QImage::bits() directly.
Bookmarks