Update der_encoder.c

refined der_encode_to_buffer