differential geometry – Poincare-hope theorem and trajectories of hamiltonian system

In this Wiki Link: https://en.wikipedia.org/wiki/Poincaré–Hopf_theorem. It says in the following picture that
enter image description here
“According to the Poincare-Hopf theorem, closed trajectories can encircle two centres and one saddle or one centre, but never just the saddle. (Here for in case of a Hamiltonian system)”

My question is how can we apply the Poincare-Hopf theorem here. The area enclosed by the outer blue curve is a manifold with a boundary. However, the vector field is not always pointing outward along the boundary or the blue curve. How can we apply the theorem?