From the man page on glPixelStore*
"If the first pixel of a row is placed at
location p in memory, then the location of
the first pixel of the next row is obtained by skipping:
k = nl if s >= a"
“where n is the number of components or indices in a pixel, l is the number of pixels in a row” … “s is the size, in bytes, of a single component”
In this case ( s >= a ) shouldn’t ‘k = nls’ not just ‘nl’ ?