Add a sanity check to partially-correct input

I was generating compressed base64 strings of the form "abc/def". I
accidentally tried decompressing just the "abc" portion of the string,
causing decompress() to hang indefinitely. This index/length check
prevents that case.