sprite_3d.cpp: fixed buffer access out of bounds.