protect against invalid chunk lengths in some tools