some more error checking, don't bother to be aggressive about pre-allocating small compressed buffer, via @jakebolewski