- totlen = enc_compute_buf_len(product, version, src_len);
- hdrlen = enc_compute_header_len(product, version);
+ if (size) {
+ tail_dst = enc_compute_buf_len(product, version, size);
+ tail_len = src_len - size;
+ totlen = tail_dst + tail_len;
+ } else
+ totlen = enc_compute_buf_len(product, version, src_len);