check_stream_sha1(): handle input underflow