Ignore stride for single-row images
If the image is a single row then the stride will not be used. In that case allow stride to be misaligned.
In some cases OpenCV will pass a hard-coded stride of 1 when the height of the image is known to be 1, so we must allow such cases.