Turns out the pitch was accidentally used as width, leading to an out of bounds read/write.
I kept the pitch in the struct for completeness' sake. It may be needed later, if only for error checks.
Depending on the dpi settings, the debug overlay was almost unreadable.
I also took the liberty to refactor some redundant client size calls and to add some margin to the left of the debug text.