Fix bug for read_sample function return buffer (when EOS state, read_sample retured...