Fix error in the clipping function if the pixels array is empty.