Shouldn't ```mask->nodata``` be ```mask->nodata[_y][_x]```?