Mysterious stomach pain when coughing

Could a liver infarct be the cause of a patient's dull, intermittent pain in the right-upper-quadrant? Or is something else to blame?