Ensure that we don't read beyond the end of the input buffer. Doing so
would cause an access violation if the input buffer ran up to the end of
a page and we didn't have read access to the next page.