I assume that you are using the FX2LP product. Please correct me if I am wrong.
In case you have configured the FX2LP to be in Auto-In/Auto-Out modes, it is the responsibility of the external device to pad the packet with dummy data, since the firmware has no control in data transfer.
In case you have configured the FX2LP with AUTOIN/AUTOOUT=0, the firmware can pad the packet with dummy data (or) the INPKTEND register can also be used to implement the hardware PKTEND functionality. To do so, keep track of the EPxBCH/BCL registers and write the INPKTEND register when the packet length is not a multiple of 512 byte.