Appeal from a judgment of the Oneida County Court (Barry M. Donalty, J.), rendered February 20, 2009. The judgment convicted defendant, upon his plea of guilty, of criminal possession of a weapon in the second degree.
It is hereby ordered that the judgment so appealed from is unanimously affirmed.
Memorandum: Defendant appeals from a judgment convicting him upon a plea of guilty of criminal possession of a weapon in the second degree (Penal Law § 265.03 [3]). The contention of defendant that he was denied effective assistance of counsel based on defense counsel’s failure to seek to suppress the handgun seized from the building in which he was staying survives his plea of guilty and waiver of the right to appeal “only insofar as he contends that his plea was infected by the allegedly ineffective assistance and that he entered the plea because of his attorney’s allegedly poor performance” (People v Bethune, 21 AD3d 1316, 1316 [2005], lv denied 6 NY3d 752 [2005]; see generally People v Petgen, 55 NY2d 529, 534-535 [1982], rearg denied 57 NY2d 674 [1982]). That contention, however, involves matters outside the record on appeal and therefore must be raised by way of a motion pursuant to CPL article 440 (see People v Neal, 56 AD3d 1211, 1211 [2008], lv denied 12 NY3d 761 [2009]; People v Jennings, 8 AD3d 1067, 1068 [2004], lv denied 3 NY3d 676 [2004]).
Defendant’s valid waiver of the right to appeal encompasses his challenge to the severity of the sentence (see People v Lopez, 6 NY3d 248, 255-256 [2006]). Present—Smith, J.P, Peradotto, Lindley, Sconiers and Valentino, JJ.