Upon reversing or modifying a judgment, sentence or order of a criminal court, an intermediate appellate court must take or direct such corrective action as is necessary and appropriate both to rectify any injustice to the appellant resulting from the error or defect which is the subject of the reversal or modification and to protect the rights of the respondent. The particular corrective action to be taken or directed is governed in part by the following rules:
N.Y. Crim. Proc. Law ยง 470.20