CVE-2017-14160: fix bounds check on very low sample rates.