Stability of an inverse hyperbolic problem