https://en.wikipedia.org/wiki/Z-%D0%B1%D1%83%D1%84...
the length of the depthData array should be equal to the width multiplied by the height.
ps I didn't work with kinect, so I could be wrong, but as far as I remember it works exactly on this principle.