demosaic: fix assertion