An infection of the heart's inner lining (endocardium) or the heart valves.