encode: fix mistake on encoded data size