fix crash on mvd cost calculation

reviewed at: https://rbcommons.com/s/OpenH264/r/766/