Fixed crash if the input data pitch is larger than the locked texture pitch