There should not be any issues with that.  Since you are currently in valid H-1B status, you are authorized to be paid for your work with that company.  Once the new company's petition on your behalf is approved, you are also able to receive money for work done for that company.