draw: fix overflows in the indexed rendering paths